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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
624483971 | # -*- coding: utf-8 -*-
from flask import render_template, flash, redirect, request
from firstapp import app
from firstapp.forms import LinkForm
from firstapp.model_stuff.checking_string import do_things
from firstapp.comments_parser import parseinst
import json
import crochet
crochet.setup()
from firstapp.instspider... | null | firstapp/routes.py | routes.py | py | 2,469 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "crochet.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scrapy.crawler.CrawlerRunner",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "firstapp.ap... |
258942059 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^signup$', views.signup),
url(r'^login$', views.login),
url(r'^customermanager$', views.customermanager),
url(r'^officemanager$', views.officemanager),
url(r'^help$', views.helppage),
... | null | main_app/urls.py | urls.py | py | 358 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"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.co... |
3814889 | """create fk user instructor
Revision ID: a10250763f6a
Revises: 1e93571e66b0
Create Date: 2019-03-31 20:17:26.774306
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'a10250763f6a'
down_revision = '1e93571e66b0'
branch_labels... | null | migrations/versions/a10250763f6a_create_fk_user_instructor.py | a10250763f6a_create_fk_user_instructor.py | py | 1,177 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer... |
97382115 | from twisted.trial import unittest
from teamcity import is_running_under_teamcity
from teamcity.unittestpy import TeamcityTestRunner
#test1
class MyFirstTestCase(unittest.TestCase):
def test_something(self):
self.assertTrue(True)
if __name__ == '__main__':
if is_running_under_teamcity():
runn... | null | tests/test_foo.py | test_foo.py | py | 435 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "twisted.trial.unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "twisted.trial.unittest",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "teamcity.is_running_under_teamcity",
"line_number": 12,
"usage_type": "call"
... |
422139001 | import os
import numpy as np
import pandas as pd
import requests
import scipy.interpolate
import shutil
import winreg
from selenium import webdriver
from bs4 import BeautifulSoup
def get_download_path():
"""
Returns the Downloads folder path
"""
sub_key = r'SOFTWARE\Microsoft\Windows\Curr... | null | Scraping Projects/Curva DI/DIxPRE.py | DIxPRE.py | py | 3,447 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "winreg.OpenKey",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "winreg.HKEY_CURRENT_USER",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "winreg.QueryValueEx",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requ... |
309029487 | #!/usr/bin/python3
# sentdex tutorial for machine learning
# https://www.youtube.com/watch?v=JcI5Vnw0b2c&list=PLQVvvaa0QuDfKTOs3Keq_kaG2P55YRn5v&index=2
# this file specifically follows on from p.5
import pandas as pd
import quandl, math
import numpy as np
from sklearn import preprocessing, cross_validation, svm
fro... | null | regression.py | regression.py | py | 1,488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "quandl.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.scale",
"l... |
290856317 | from multiprocessing import Process, Event
import time
def task1(e, msg):
print('task1 is waitting')
e.wait()
time.sleep(1)
print('hello, {0}, e.is_set(): {1}'.format(msg, e.is_set()))
def task2(e, msg):
print('task2 is waitting')
e.wait(msg)
print('hello, {0}, e.is_set(): {1}'.format(msg,... | null | practices/MulitProcess2.py | MulitProcess2.py | py | 561 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Event",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "multiprocessi... |
256256141 | import pygame, time
pygame.init()
scr = pygame.display.set_mode((600, 500))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
scr.fill((255, 255, 255))
pygame.draw.circle(scr, (200, 0, 0), (250, 250), 80)
pygame.display.flip(... | null | pygame/circle.py | circle.py | py | 373 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get... |
123025543 | from BasePage import BasePage
from BasePage import IncorrectPageException
from AdminEditEnterprise import AdminEditEnterprisePage
from selenium.common.exceptions import NoSuchElementException
import time
class AdminEnterprisesPage(BasePage):
def __init__(self, driver):
super(AdminEnterprisesPage, self)._... | null | documents/Test/TestCode/PythonCode/code/local/firefox/MarketplaceGoogleApp_usqa/pages/AdminEnterprisesPage.py | AdminEnterprisesPage.py | py | 1,193 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "BasePage.BasePage",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "BasePage.IncorrectPageException",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "selenium.common.exceptions.NoSuchElementException",
"line_number": 27,
"usage_type": "na... |
559883295 | import os
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
required_conan_version = ">=1.33.0"
class LibPciAccessConan(ConanFile):
name = "libpciaccess"
description = "Generic PCI access library"
topics = ("... | null | recipes/libpciaccess/all/conanfile.py | conanfile.py | py | 2,727 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "conans.ConanFile",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "conans.errors.ConanInvalidConfiguration",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "conan.tools.gnu.AutotoolsToolchain",
"line_number": 49,
"usage_type": "call"
}... |
278865585 | #!/usr/bin/env python3
import os
import sys
import cProfile # pylint: disable=import-error
import pprofile # pylint: disable=import-error
import pyprof2calltree # pylint: disable=import-error
from common.params import Params
from tools.lib.logreader import LogReader
from selfdrive.test.profiling.lib import SubMaste... | null | selfdrive/test/profiling/profiler.py | profiler.py | py | 2,593 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selfdrive.test.process_replay.process_replay.CONFIGS",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "common.params.Params",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "selfdrive.test.profiling.lib.SubMaster",
"line_number": 34,
"us... |
550312526 | from bs4 import BeautifulSoup
from selenium import webdriver
import re
option = webdriver.ChromeOptions()
option.add_argument('headless')
driver = webdriver.Chrome(options=option)
class kkday:
def __init__(self):
self.alldata = dict()
self.singleNewsSoup = None
self.singleNews = d... | null | 爬蟲/kkday_crawler/crawl.py | crawl.py | py | 6,382 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_na... |
61671290 | #导入各种需要的包#
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
#定义所需要拟合的带参数的一般函数类型#
def fmax(x,a,b,c):
return a*np.sin(x*np.pi/6+b)+c
'''
def func(x, a, b, c):
return a * np.exp(-b * x) + c'''
def ekc(x,a,b1,b2,u):
return np.exp(a+u+b1*np.log(x)+b2*(np.log(x)**2))
#输入数据#
# x=np.... | null | python/118843/pro4.py | pro4.py | py | 1,520 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.sin",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 14,
... |
71292640 | ################################################################################
# Copyright (c) 2013-2023, National Research Foundation (SARAO)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# ... | null | src/katsdpcontroller/web.py | web.py | py | 14,707 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "yarl.URL",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "aiokatcp.Sensor.Status",
... |
144709669 | #linear Discriminant analysis
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import math
from scipy.stats import norm
import scipy.stats as stats
def fisher(filename):
plt.title(filename)
plt.xlabel('Dimension_1')
plt.ylabel('Dimension_2')
dataset=pd.read_csv(filename,header=None)... | null | Fisher.py | Fisher.py | py | 4,849 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.title",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "ma... |
271052769 | # -*- coding:utf-8 -*-
__author__ = ''
__date__ = '2017/5/23 15:59'
import json
import random
from django.core.cache import caches
from django.http import HttpResponse
import utils.SmsSender as SmsSender
def main(request):
# 请根据实际 appid 和 appkey 进行开发,以下只作为演示 sdk 使用
appid = 1400029439
appkey = "7cd51448... | null | apps/api/views/sms.py | sms.py | py | 1,335 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.SmsSender.SmsSingleSender",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "utils.SmsSender",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.l... |
279825103 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 8 11:12:27 2019
@author: yuany
description: standard encoder-decoder model for remote sensing time series prediction
"""
import seq2seq
import time
import numpy as np
import matplotlib.pyplot as plt
seed = 7
np.random.seed(seed)
# Main Run Thread
if __name__ == '__... | null | baseline_model/keras/model_train.py | model_train.py | py | 1,688 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.seed",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "seq2seq.load_data",
... |
297319457 | import cv2
from PIL import Image
from http.server import BaseHTTPRequestHandler,HTTPServer
#from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import io
import socket
import time
import re
import subprocess
import targetingSystem
#extract the ip address (or addresses) from ifconfig
found_ips = []
ips = re.... | null | luv2see/backCam.py | backCam.py | py | 3,322 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.getoutput",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "cv... |
629321018 | from IPython.display import display, HTML
from pathlib import Path
import subprocess
from ipaddress import IPv4Address, AddressValueError
from multiprocessing import Pool
import requests
import copy
def check_parameters(**kwargs):
params = kwargs['_params'] if '_params' in kwargs else {}
for k, v in kwargs.it... | null | OpenHPC-v1/scripts/utils.py | utils.py | py | 6,876 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "IPython.display.display",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "IPython.display.HTML",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "pathlib.Pat... |
186089052 | # -*- coding: utf-8 -*-
import unittest
from app import db, create_app
from app.models import Role, Student, GradeLog, User, ManageLog, Permission
from flask import url_for
import re
from flask.ext.login import current_user
from sqlalchemy import and_
import random
class BaseTestCase(unittest.TestCase):
"""一些登陆登出... | null | tests/test_view.py | test_view.py | py | 4,859 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "app.db.create_all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.db",
... |
149377978 | # SJTU EE208
import sys, os, lucene
from hightlighter import Highlighter
from cache import Cache
from java.io import File
from java.io import StringReader
from org.apache.lucene.analysis import TokenStream
from org.apache.lucene.analysis.cjk import CJKAnalyzer
from org.apache.lucene.index import DirectoryReader
from ... | null | lab7/src/searcher.py | searcher.py | py | 6,087 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lucene.initVM",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cache.Cache",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "org.apache.lucene.store.SimpleF... |
68039053 | from os.path import abspath, dirname, join
import setuptools
about: dict = {}
here = abspath(dirname(__file__))
with open(join(here, "model_bakery", "__about__.py")) as f: # type: ignore
exec(f.read(), about)
setuptools.setup(
name="model_bakery",
version=about["__version__"],
author=about["__author... | null | setup.py | setup.py | py | 1,622 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"lin... |
154587249 | from django.http import HttpResponseRedirect
from django.http.response import HttpResponse, HttpResponseBadRequest, JsonResponse
from django.urls import reverse
from django.views.generic import ListView, DetailView
from django.shortcuts import get_object_or_404
from django.contrib import messages
from account.models i... | null | projects/views.py | views.py | py | 6,262 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Project.objects.active",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Project.objects",
"line_number": 14,
"usage_type": "attribute"
},
... |
573179286 | from django.conf.urls import url
from . import views
app_name = 'approve'
urlpatterns = [
# 审批设置列表页面
url(r'^setIndex/$', views.setIndex, name='setIndex'),
# 我发起的页面
url(r'^mySend/$', views.mySend, name='mySend'),
# 待我审批页面
url(r'^myReceive/$', views.myReceive, name='myReceive'),
# 审批表单页面
... | null | approve/urls.py | urls.py | py | 1,448 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django... |
137499371 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
为了简化并更好地标识异步 IO,
从 Python 3.5 开始引入了新的语法 async 和 await,可以让 coroutine 的代码更简洁易读。
"""
import threading
import asyncio
async def hello():
print('Hello world! (%s)' % threading.currentThread())
# 异步调用 asyncio.sleep(1):
await asyncio.sleep(1)
print('Hello ... | null | async/async_hello2.py | async_hello2.py | py | 645 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.currentThread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "threading.currentThread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "asyncio... |
628765102 | #!/usr/bin/env python
#coding:utf-8
from flask.ext.script import Manager, Server
from scapp import app
manager = Manager(app)
server = Server(host='0.0.0.0', port=8888)
manager.add_command("runserver", server)
if __name__ == '__main__':
manager.run()
| null | run.py | run.py | py | 260 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.ext.script.Manager",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scapp.app",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": "flask.ext.script.Server",
"line_number": 10,
"usage_type": "call"
}
] |
33494617 | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
from codecs import open
import os
import re
import versioneer
CLASSIFIERS = """
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programmin... | null | setup.py | setup.py | py | 2,693 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_... |
379127471 | # coding: utf-8
import numpy as np
from PCA import PCA
from show_face import show_face
import matplotlib.pyplot as plt
import scipy.io as scio
from sklearn import neighbors
data=scio.loadmat('ORL_data.mat')
train_data=data['fea_Train']
train_label=data['gnd_Train'].reshape(-1)
test_data=data['fea_Test']
test_label=da... | null | hw4/src/pca/knn_after_DR.py | knn_after_DR.py | py | 1,001 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PCA.PCA",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "show_face.show_face",
"line_num... |
253265858 | #!/usr/bin/env python3
import numpy as np
import re
import random
import feedparser
from operator import itemgetter
def create_data_set():
docs = [['my', 'dog', 'has', 'flea', 'problem', 'help', 'please'],
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'],
['my', 'dalmation',... | null | bayes.py | bayes.py | py | 6,394 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.sum",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 53,
... |
2105948 | #!/usr/bin/env python3
#-*- coding:utf-8 -*-
#VERSION DISCORD PY D'UN JEU DE PUISSANCE 4
#******************
#******************
#from p4_funct import jouer,coup_gagnant #import des fonctions spécifiques au jeu
import csv
import discord
from discord.ext import commands
import asyncio
bot = commands.Bot(command_prefix=... | null | p4.py | p4.py | py | 13,991 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "discord.Activity",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "discor... |
590931777 | # MIT License
#
# Copyright (c) 2019, University of Oxford
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | null | exp_5_2/train.py | train.py | py | 6,784 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "torch... |
6315672 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
from sklearn.datasets import fetch_lfw_people
faces = fetch_lfw_people(min_faces_per_person=60)
print(faces.target_names)
print(faces.images.shape)
# با استفاده از یک دیتاست معروف و آموزشی که حاوی چهره های افراد مشهور دنیای سیاست میباشد این سیستم طراحی شده است
# In[... | null | ساخت سیستم تشخیص چهره با SVM.py | ساخت سیستم تشخیص چهره با SVM.py | py | 3,832 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.fetch_lfw_people",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api... |
652921014 | import unittest
import numpy as np
from dacbench import AbstractEnv
from dacbench.envs import ModeaEnv
from dacbench.abstract_benchmark import objdict
from gym import spaces
class TestModeaEnv(unittest.TestCase):
def make_env(self):
config = objdict({})
config.budget = 20
config.datapath =... | null | tests/envs/test_modea.py | test_modea.py | py | 1,523 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "dacbench.abstract_benchmark.objdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "... |
562182218 | import bpy
from math import sqrt
# ERROS
def ERROselFaceDef(self, context):
self.layout.label("Please, select the FACE MESH!")
def ERROTermSelFace():
CRED = '\033[91m'
CEND = '\033[0m'
print(CRED + "Please, select the FACE MESH!" + CEND)
def ERROmodoDef(self, context):
self.layout.label("Pu... | null | AlinhaRedimFotogrametria.py | AlinhaRedimFotogrametria.py | py | 7,994 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bpy.context",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "bpy.context.window_manager.popup_menu",
"line_number": 45,
"usage_type": "call"
},
{
"api_name"... |
58628852 |
import networkx as nx
from micropsi_core import tools
from micropsi_core.nodenet.node import FlowNodetype
from micropsi_core.nodenet.flow_engine import FlowEngine
from micropsi_core.nodenet.flow_netapi import FlowNetAPI
from micropsi_core.nodenet.dict_engine.dict_nodenet import DictNodenet
from micropsi_core.nodenet... | null | micropsi_core/nodenet/numpy_engine/numpy_nodenet.py | numpy_nodenet.py | py | 5,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "micropsi_core.nodenet.flow_engine.FlowEngine",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "micropsi_core.nodenet.dict_engine.dict_nodenet.DictNodenet",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "micropsi_core.nodenet.node.FlowNodetype",... |
138763953 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 20 17:27:36 2019
@author: bangde
"""
import requests
from bs4 import BeautifulSoup
url = "http://www.budejie.com"
headers={"User-Agent":"Mozilla/5.0"}
#获取源码
res = requests.get(url,headers=headers)
res.encoding="utf-8"
html = res.text
#创建解析对象并解析
soup = BeautifulSoup(ht... | null | linux/language/python/code/spider/spider28_BSp.py | spider28_BSp.py | py | 477 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 20,
"usage_type": "call"
}
] |
313590568 | from __future__ import annotations
import colorsys
from dataclasses import dataclass, astuple
from .constants import GLOBAL_CFG
from .types import *
MINECRAFT_COLORS = [
# Minecraft formatting codes
# ==========================
"&0/\033[38;5;0m", "&1/\033[38;5;4m", "&2/\033[38;5;2m", "&3/\033[38;5;6m"... | null | hyfetch/color_util.py | color_util.py | py | 7,605 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "constants.GLOBAL_CFG.debug",
"line_number": 77,
"usage_type": "attribute"
},
{
"api_name": "constants.GLOBAL_CFG",
"line_number": 77,
"usage_type": "name"
},
{
"api_name": "dataclasses.astuple",
"line_number": 111,
"usage_type": "call"
},
{
"api_nam... |
294338786 | import argparse
import warnings
# Standard imports
import numpy as np
import pandas as pd
# For Gower Distance
import gower
# For data preprocessing
from sklearn.preprocessing import StandardScaler
from sklearn_pandas import DataFrameMapper
# For the SUPPORT dataset
from pycox.datasets import support
# SDV aspects... | null | sdv_baselines.py | sdv_baselines.py | py | 5,778 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "utils.set_seed",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sdv.tabular.CopulaGAN",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "sdv.tabu... |
520630174 | from hackman_notifier import api as notification_api
from hackman_payments import enums as payment_enums
from hackman_payments import api as payment_api
from hackman_door import api as door_api
import json
def door_open_if_paid(user_id, _door_api=None):
"""Open door if paid and send pubsub notification accordingl... | null | hackman/api.py | api.py | py | 877 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "hackman_payments.api.has_paid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hackman_payments.api",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "hackman_payments.enums.PaymentGrade",
"line_number": 11,
"usage_type": "call"
},
{... |
580539366 | import sys,types,os,glob
os.environ["CUDA_VISIBLE_DEVICES"] = str(sys.argv[4])
from six import string_types
#import site
#sys.path = [site.USER_BASE] + sys.path
if __package__ is None:
sys.path.append(os.path.realpath("/data/shared/Software/"))
sys.path.append(os.path.realpath("../"))
print(sys.path)
#Prevent T... | null | delphi_analysis/L1Sweep1.py | L1Sweep1.py | py | 11,683 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
636336427 | import db
import live
import re
from datetime import datetime,timedelta
import json
import time
def weekday():
day=['MON','TUE','WED','THU','FRI','SAT','SUN']
utc_now=datetime.utcnow()
now=utc_now+timedelta(hours=5,minutes=30)
return day[now.weekday()]
def toseconds(m):
s=m['departure']
i... | null | api/arrivals.py | arrivals.py | py | 2,982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.timedelta",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "db.open... |
99977846 | #! /usr/bin/env python
from ucsmsdk.ucshandle import UcsHandle
HANDLE = UcsHandle("10.10.20.110", "ucspe","ucspe")
# Login into Cisco UCS Manager
HANDLE.login()
# Retrieve all the compute blades
BLADES = HANDLE.query_classid("ComputeBlade")
print('{0:23s}{1:8s}{2:12s}{3:14s}{4:6s}'.format(
"DN",
"SERIAL",
... | null | Week4/UCSMDemo.py | UCSMDemo.py | py | 678 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ucsmsdk.ucshandle.UcsHandle",
"line_number": 3,
"usage_type": "call"
}
] |
644496545 | from functools import wraps
from django.shortcuts import redirect
from box.shop.cart.utils import get_cart
from box.shop.order.models import Order
def cart_exists(function):
@wraps(function)
def wrap(request, *args, **kwargs):
cart = get_cart(request)
order = Order.objects.filter(
cart=cart,
... | null | box/decorators.py | decorators.py | py | 754 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "box.shop.cart.utils.get_cart",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "box.shop.order.models.Order.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "box.shop.order.models.Order.objects",
"line_number": 11,
"usage_t... |
5818246 | #!/usr/bin/env python
# coding=utf-8
from __future__ import unicode_literals, absolute_import, print_function, division
import sopel.module
import urllib2
import json
from BeautifulSoup import BeautifulSoup
from random import randint
import sys
import os
shareddir = os.path.dirname(os.path.dirname(__file__))
sys.path.a... | null | modules/Main/Thanks_Spicebot.py | Thanks_Spicebot.py | py | 1,119 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
575002007 | import math
from typing import List, Union
import numpy as np
def convert_rotation_matrix_to_degrees(m0, m1, m2, m3, m4, m5, m8):
angle_y = -math.asin(round(m2, 6))
c = math.cos(angle_y)
if abs(c) > 0.005:
translate_x = m8 / c
translate_y = -m5 / c
angle_x = (math.atan2(translate_... | null | utilities/math_utilities.py | math_utilities.py | py | 1,713 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math.asin",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "math.atan2",
"line_number": 20,
"... |
391772835 | import logging
import os
import paramiko
from paramiko import SFTPAttributes
from mocksftp.decorators import returns_sftp_error
__all__ = [
'SFTPServerInterface',
]
class SFTPHandle(paramiko.SFTPHandle):
log = logging.getLogger(__name__)
def __init__(self, file_obj, flags=0):
super(SFTPHandle... | null | src/mocksftp/interface.py | interface.py | py | 2,318 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "paramiko.SFTPHandle",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "paramiko.SFTPServerInterface",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_... |
141491765 | from pymongo import MongoClient
from algotrader.config.persistence import MongoDBConfig
from algotrader.provider.persistence.data_store import DataStore, RefDataStore, TimeSeriesDataStore, TradeDataStore, \
SequenceDataStore
from algotrader.utils import logger
from algotrader.utils.date_utils import DateUtils
from... | null | algotrader/provider/persistence/mongodb.py | mongodb.py | py | 9,180 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "algotrader.provider.persistence.data_store.RefDataStore",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "algotrader.provider.persistence.data_store.TradeDataStore",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "algotrader.provider.persistence... |
604627612 | import sys
def index_traces(trdata):
print('data is:',type(trdata))
count=0
for rec in trdata:
try:
del rec['@context'] # not needed in index
res = es.index(
index=idx,
doc_type='trace',
#id=whg_id,
body=rec)
count +=1
except:
prin... | null | traces/es_traces.py | es_traces.py | py | 1,407 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.exc_info",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"... |
553251528 | # -- coding: utf-8 --
from os import getenv
from flask import Flask, jsonify, request
import database as db
app = Flask(__name__)
# Server settings
expose = getenv("EXPOSE_SERVER", False)
if expose:
host = "0.0.0.0.0"
else:
host = "127.0.0.1"
port = getenv("SERVER_PORT", 8080)
@app.route("/", methods=... | null | app.py | app.py | py | 1,312 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 36,... |
615247876 | """
This resource provides information about the data holdings of the
server. This information is used by ArcGIS for Desktop and other
clients to validate data paths referenced by GIS services.
You can register new data items with the server by using the
Register Data Item operation. Use the Find Data Items operat... | null | arcpyenv/arcgispro-py3-clone/Lib/site-packages/arcgis/gis/server/admin/_data.py | _data.py | py | 47,377 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "_common.BaseServer",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 270,
"usage_type": "call"
},
{
"api_name": "arcgis.gis.server.Uploads",
"line_number": 318,
"usage_type": "call"
},
{
"api_name": "arcgis.gis.se... |
555503602 | #CBC Padding Oracle Attack demonstration
from Implement_CBC_mode import encryptAES_ECB_CBC, decryptAES_ECB_CBC
from PKCS7_Padding_Validation import testPadding
from os import urandom
from random import randint
from Cryptodome.Cipher import AES
from base64 import b64decode
randomAESKey = urandom(AES.block_siz... | null | Set 3/CBC_Padding_Oracle.py | CBC_Padding_Oracle.py | py | 2,780 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.urandom",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "Cryptodome.Cipher.AES.block_size",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "Cryptodome.Cipher.AES",
"line_number": 10,
"usage_type": "name"
},
{
"api_name":... |
506773251 | import argparse
pars = argparse.ArgumentParser()
pars.add_argument("--name", help="Write your name", type=str)
pars.add_argument("--gender", help="Choose your gender: male, female", type=str,
choices=["male", "female"])
pars.add_argument("h", help="Write your height (cm)", type=float)
pars.add_argume... | null | main.py | main.py | py | 3,141 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
}
] |
241019733 | import re
import unittest
from collections import defaultdict
from pprint import pprint
from typing import List, Set
import itertools
def addr(input_register: List, instruction: tuple) -> List:
output_registers = input_register.copy()
output_registers[instruction[3]] = input_register[instruction[1]] + input_... | null | solutions/day16/day16.py | day16.py | py | 11,849 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
442757098 | from flask import Flask, jsonify, request, render_template, json
app = Flask(__name__)
from utils import vader_model, bert_model
from models import Lexicon_dictionary, Sentiment_score
#### GET REQUEST ####
@app.route("/get_model_details/", methods = ["GET"])
def get_model_details():
model_details = {
... | null | Lab02_Flask_Model_Deployment/app_vader_bert_completed.py | app_vader_bert_completed.py | py | 3,559 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.request.args",... |
538810645 | from fst import EPSILON
from noise import FinalDevoicingNoise
simulation_number = 1
configurations_dict = \
{
"MUTATE_RULE_SET": 1,
"MUTATE_HMM": 1,
"EVOLVE_RULES": True,
"EVOLVE_HMM": True,
"COMBINE_EMISSIONS": 1,
"MERGE_EMISSIONS": 0,
"ADVANCE_EMISSION": 1,
"CLONE_STATE": 0,
"CLONE_EMISSION": 1,
"SPLIT_EMISSION":... | null | source/simulations/dam_ka_natural_ilm_final_devoicing.py | dam_ka_natural_ilm_final_devoicing.py | py | 4,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "noise.FinalDevoicingNoise",
"line_number": 120,
"usage_type": "name"
},
{
"api_name": "fst.EPSILON",
"line_number": 137,
"usage_type": "name"
}
] |
311802919 | import pytest
from tests.functional.utils import build_chrome
@pytest.yield_fixture(scope="session", autouse=True)
def browser():
_browser = build_chrome()
# _browser = build_firefox()
yield _browser
_browser.close()
_browser.quit()
| null | tests/functional/conftest.py | conftest.py | py | 256 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tests.functional.utils.build_chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pytest.yield_fixture",
"line_number": 6,
"usage_type": "call"
}
] |
143315062 | # /usr/bin/env python3
# encoding: utf-8
"""
Usage:
sim_cca [-r RULE] [-a SIZE] [-s COUNT | -p | -n] QUANTITIES...
Options:
-a SIZE, --alphabet SIZE Alphabet size [default: 2]
-r RULE, --rule RULE Local update rule [default: a,b: a^b]
-s COUNT, --samples COUNT For m... | null | sim_cca/main.py | main.py | py | 2,976 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cca.Quantity.from_string",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "cca.Quantity",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "docopt.docopt",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "cca.Layouter... |
130813838 | # -*- coding: utf-8 -*-
from flask import request, current_app, Blueprint, g
from ..errors import UPUSH_ERR
from ..flaskutils import tracecall, nocache
from ..flaskutils import U_collect_params, U_mkret
user_logout_blueprint = Blueprint('user_logout', __name__)
@user_logout_blueprint.route('/user/logout', methods=[... | null | upush/api/commands/command_user_logout.py | command_user_logout.py | py | 758 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flaskutils.U_collect_params",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "flask.cu... |
354284322 | #!/usr/bin/python3
# coding=utf-8
# Copyright 2021 getcarrier.io
#
# 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 req... | null | module.py | module.py | py | 2,146 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pylon.core.tools.module.ModuleModel",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pylon.core.tools.module",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "pylon.core.tools.log.info",
"line_number": 40,
"usage_type": "call"
},... |
250013288 | import boto3
import configparser
import sys
import os
import time
config = configparser.ConfigParser()
config.read('ingress_param.ini')
workernode_role_names = str(config['alb']['workernodes_instance_role_name'])
workernode_role = workernode_role_names.split(",")
#Attaching IAM policy for ALB ingress controller
for ... | null | EKS_ALB_Ingress_installer/alb_ingress_contoller_installer.py | alb_ingress_contoller_installer.py | py | 1,060 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_n... |
264124842 | from django.urls import path
from . import views
urlpatterns = [
path('users/', views.UsersView.as_view(), name='users'),
path('users/create/', views.UserCreateView.as_view(), name='users_create'),
path('users/<int:pk>/update/', views.UserUpdateView.as_view(), name='users_update'),
path('users/<int:pk>... | null | cvat/apps/management/urls.py | urls.py | py | 2,015 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
437119127 | from sqlalchemy import Column, Date, DateTime, ForeignKey, Integer, text
from sqlalchemy.orm import relationship, backref
from pyramid.security import Allow
from .meta import Base
class CalendarEntry(Base):
__tablename__ = "calendar_entry"
id = Column(Integer, primary_key=True)
organization_has_user_id... | null | corona/models/calendar_entry.py | calendar_entry.py | py | 1,116 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "meta.Base",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "sqlalchemy.Column",... |
380354592 | from django.shortcuts import render
from calendar_events.core.models import *
from calendar_events.core.serializers import *
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework import viewsets, status
from rest_framework_jwt.views import JSONWebTokenAPIView
class AuthUserViewSet(views... | null | calendar_events/core/views.py | views.py | py | 2,255 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.AllowAny",
"line_number": 11,
"usage_type": "n... |
561524675 | # Copyright 2018, The TensorFlow Federated 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 o... | null | tensorflow_federated/python/core/impl/compiler/intrinsic_reductions.py | intrinsic_reductions.py | py | 10,304 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Callable",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "tensorflow_federated.python.core.impl.compiler.building_blocks.ComputationBuildingBlock",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "tensorflow_federated.python.core.imp... |
444311875 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from contextlib import contextmanager
from optparse import OptionParser
from tempfile import NamedTemporaryFile
from twitter.common.contextutil import temporary_dir
from pex.bi... | null | tests/test_pex_binary.py | test_pex_binary.py | py | 7,227 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pex.resolver_options.ResolverOptionsBuilder",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "contextlib.contextmanager",
"line_number": 26,
"usage_type": "name"
}... |
109990299 | #!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
import websocket
import ssl
import json
import requests
import sys
HEADERS = {'user-agent': 'python-developer'}
CHANID_PAIR = {}
TMP = {}
def load_config(config_filename):
with open(config_filename, 'r') as fd:
json_data = json.loads(fd.read())
return json_d... | null | tcl.py | tcl.py | py | 2,908 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 71,... |
25244241 | import gym
from MemoryBufferClass import MemoryBuffer
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Model
from keras.layers import Dense, BatchNormalization, Input, concatenate, Activation, Lambda
from keras.models import load_model
from keras import optimizers
import parameters
from netwo... | null | DDPG/train.py | train.py | py | 4,655 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gym.make",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "parameters.ENV",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "networks.generate_critic",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "networks.genera... |
504892 | def makedatapars(D, verbose=2):
"""
Translates the raw data (which were read from the spreadsheet). into
parameters that can be used in the model. These are then used
These data are then used to update the corresponding model (project).
This method should be called before any simulation can run.
... | null | server/src/sim/makedatapars.py | makedatapars.py | py | 6,396 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "printv.printv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "utils.sanitize",
"line_numb... |
539274242 | """Various utility functions for instrument monitors
Authors
-------
- Matthew Bourque
- Bryan Hilbert
Use
---
This module can be imported as such:
>>> import monitor_utils
settings = monitor_utils.update_monitor_table('dark_monitor')
"""
import datetime
import os
from jwql.database.databas... | null | jwql/utils/monitor_utils.py | monitor_utils.py | py | 4,827 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "jwql.utils.constants.ASIC_TEMPLATES",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 66,
"usage_type": "attribute"
},
{
"... |
623697637 | from django.urls.conf import path
from QA import views
from .views import SearchResultsView
app_name = 'QA'
urlpatterns = [
path('', views.TodaysQuestionList.as_view(), name='daily_question'),
path('ask', views.about, name='about'),
path('home/ask', views.AskQuestionView.as_view(), name='ask'),
#... | null | QA/urls.py | urls.py | py | 1,147 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.conf.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "QA.views.TodaysQuestionList.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "QA.views.TodaysQuestionList",
"line_number": 9,
"usage_type": "attribute"
},
... |
63900557 | import argparse
import pathlib
import json
import requests
from folioclient.FolioClient import FolioClient
parser = argparse.ArgumentParser()
parser.add_argument("indexname", help="name of elastic index")
parser.add_argument("from_path", help="path to file holdings the items")
args = parser.parse_args()
payload = []
... | null | elasticloader.py | elasticloader.py | py | 1,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
562232120 | import json
import hashlib
from threading import Event, Thread
def call_repeatedly(interval, func, *args):
stopped = Event()
def loop():
while not stopped.wait(interval): # the first call is in `interval` secs
func(*args)
Thread(target=loop).start()
return stopped.set
def proce... | null | backend/blockchain/utils.py | utils.py | py | 3,562 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Event",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_nu... |
606784167 | import sys
import numpy as np
import glob
import math
from PIL import Image
X = np.empty((1000, 12288))
Y = np.empty((1000, 1))
for i in range(2,1001, 2):
name = glob.glob(r"C:\Users\Alex\Desktop\Junk\TrainingSet\S ("+str(i//2)+").jpg")
name2 = glob.glob(r"C:\Users\Alex\Desktop\Junk\NotSandwich\N ("+str(i/... | null | SandwichNN.py | SandwichNN.py | py | 6,850 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.empty",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 11,
... |
647698274 | #!/usr/bin/env python3
import PIL
from PIL import Image
import sys
import os
import logging
logging.basicConfig(level=logging.INFO)
def get_file_list(dirpath):
'''
This method returns a list of path of files within the specified dirpath.
It returns a file path list if all goes well otherwise returns None.... | null | Scripts/changeImage.py | changeImage.py | py | 3,083 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.error",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
... |
136349244 | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.utils.data as torch_dt
from torchvision import transforms, datasets
USE_CUDA = torch.cuda.is_available()
DEVICE = torch.device("cuda" if USE_CUDA else "cpu")
EPOCHS = 40
BATCH_SIZE = 64
# Makes sure that you ... | null | CNN/Basic_CNN.py | Basic_CNN.py | py | 4,109 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.D... |
205597526 | import cv2
import numpy as np
import os
from PIL import Image
from resizeimage import resizeimage
path = 'E:/Haar Training Data/positive'
basewidth = 32
directory = os.fsencode(path)
current_directory = os.getcwd()
dest_directory ='E:/Haar Training Data/pos'
def edit_pos_images():
if not os.path.exists(de... | null | scripts/resize.py | resize.py | py | 987 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.fsencode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
... |
209926808 | import numpy as np
import os
import matplotlib.pyplot as plt
from skimage import io
import pandas as pd
# Define the data dimensions
# images are 128 x 118 with 1 channel of color (gray),_c and _v
input_dim_model = (1, 128, 118)
input_dim_row = 128
input_dim_col = 118
# used by readers to treat input data... | null | prepareData1.py | prepareData1.py | py | 5,050 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.float64",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_... |
428991195 | import asyncio
import logging
import random
from aiogram.utils import exceptions
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.triggers.cron import CronTrigger
from api import currency_parser
from api.api import get_news, get_weather
from data import db
from keyboards.reply.default_keyb... | null | main.py | main.py | py | 7,092 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "apscheduler.schedulers.asyncio.AsyncIOScheduler",
"line_number": 18,
"usage_type": "call"
},
{
... |
579179639 | #################################
##--- VictorDamian
##--- Python 3.7.8 - OpenCV 3.5.3
##--- INFO: https://docs.opencv.org/master/db/deb/tutorial_display_image.html
#################################
import cv2 as cv
import sys
path_img = 'img/ellen2.jpg'
def openFile(image):
img = cv.imread(cv.samples.findFile(i... | null | 1.InterfazGrafica/openImage.py | openImage.py | py | 667 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.samples.findFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.samples",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line... |
586286292 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from core.models import Countrys
from shops.models import Category, Shops
from shops.shop import render_one_shop, chek_3_shop, padeg
from core.cache_function import cache_function
from core.check_counter_of_process import check_counter_of_proce... | null | core/management/commands/cache_render_shops.py | cache_render_shops.py | py | 7,538 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "shops.models",
"line_number": 26,
"usage_type": "argument"
},
{
"api_name": "core.models.Countrys.objects.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "core.mod... |
623875071 | import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from character import Character
SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']
def main():
data = dict()
# Load p... | null | app.py | app.py | py | 2,270 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line... |
376562744 | import discord
from discord.ext import commands
import datetime
snipes = dict()
server_config = dict()
def snipe_embed(self, message, user):
if message.author not in message.guild.members or message.author.color == discord.Color.blue():
embed = discord.Embed(description=message.content, timesta... | null | Ice/Cogs/Snipe.py | Snipe.py | py | 3,355 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.Color.blue",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "discord.Color",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "discord.Embed",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.Embed",
... |
113132021 | '''
Data credits: Mengting Wan, Rishabh Misra, Ndapa Nakashole, Julian McAuley, "Fine-Grained Spoiler Detection from Large-Scale Review Corpora", in ACL'19.
'''
import collections
import itertools
import os
import gzip
import json
import pickle
import re
import string
import math
# import nltk
# nltk.download('stopwor... | null | dataprepgr.py | dataprepgr.py | py | 8,951 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "loggingutil.get_logger",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 36,
"usage_type": "name"
},
{
"api_name... |
440754256 |
'''
Class Crawler gether info from site http://forum.overclockers.ua/viewforum.php?f=26
about: post title, author, price, currency, url and first title
==========================
Цель: написать веб-скрапер для одного из разделов сайта forum.overclockers.ua
На сайте overclockers.ua по адресу http://forum.overcloc... | null | hometask_06/6_4_db.py | 6_4_db.py | py | 12,332 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.connect",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "aiohttp.TCPCon... |
386657246 | """dataone.py
Defines class used for the DataOne web service.
Created by BrickSimple
"""
from urllib2 import urlopen
import logging
import copy
from gomoto.utils import json2obj
from django.conf import settings
logger = logging.getLogger(__name__)
__all__ = ['fetch', 'DataOne']
class DataOne(object):
"""D... | null | vehicles/dataone.py | dataone.py | py | 9,521 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 187,
"usage_type": "call"
},
{
"api_name": "gomoto.utils.json2obj",
"line_number": 188,
"usage_type": "call"
},
{
"api_name": "django.conf... |
654206943 | # uncompyle6 version 3.7.4
# Python bytecode 2.6 (62161)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-i686/egg/pagingish/genericpager.py
# Compiled at: 2010-02-04 05:16:20
import itertools
class SkipLimitPager(object):
"""
Generic effic... | null | pycfiles/pagingish-0.1-py2.6/genericpager.py | genericpager.py | py | 1,279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.islice",
"line_number": 36,
"usage_type": "call"
}
] |
176678343 | import numpy as np
import torch
from mnist import MNIST
import matplotlib.pyplot as plt
import scipy.ndimage as scnd
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
device = torch.device("cpu... | null | MNIST_PyTorch.py | MNIST_PyTorch.py | py | 3,427 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.uint8",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "torch.zeros",
"line_num... |
218332752 | import json
import sys
import os
import time
from azureml.core.model import Model
import numpy as np
#import onnxruntime
def init():
global session
model=os.path.join(os.getenv('AZUREML_MODEL_DIR'),'cifar10_net.onnx')
session=onnxruntime.InferenceSession(model)
# input=session.get_inputs()[0].name
... | null | examples/cifar10core.py | cifar10core.py | py | 3,455 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
311158043 | import cv2 as cv
import numpy as np
cap = cv.VideoCapture(0)
while(1):
_, imageFrame = cap.read()
hsv_frame = cv.cvtColor(imageFrame, cv.COLOR_BGR2HSV)
low_red = np.array([161,155,84])
high_red = np.array([179,255,255])
red_mask = cv.inRange(hsv_frame, low_red, high_red)
red= cv.bitwise_... | null | renktanima.py | renktanima.py | py | 1,993 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"... |
82734085 | from django import template
from django.utils.html import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
def render_plugin(context, plugin):
"""
Render a single plugin. Requires the
:class:`feincms3.renderer.TemplatePluginRenderer` instance in the context
as ``rende... | null | feincms3/templatetags/feincms3_renderer.py | feincms3_renderer.py | py | 1,951 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.utils.html.mark_safe",
"line_number": 42,
"usage_type": "call"
}
] |
218315095 | # -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 9
_modified_time = 1425145700.54056
_enable_loop = True
_template_filename = 'C:\\Compfitition-2.1\\base_app\\templates/base_ajax_template.htm'
_template_uri ... | null | shop/cached_templates/templates/base_ajax_template.htm.py | base_ajax_template.htm.py | py | 2,132 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mako.runtime.UNDEFINED",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "mako.runtime",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "base_app.static_files.StaticRenderer",
"line_number": 33,
"usage_type": "call"
},
{
"api_n... |
292713741 | from models.user import User
from models.account_follower import Account_follower
from flask import Blueprint, flash, render_template,request,redirect,url_for,session,abort
from flask_login import login_user,login_required,logout_user,current_user
followers_blueprint=Blueprint('followers',
... | null | instagram_web/blueprints/followers/views.py | views.py | py | 2,814 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.account_follower.Account_follower",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.user.User.get_by_id",
"line_number": 18,
"usage_type": "call"
},
{
... |
407755920 | #!/usr/bin/env python
import os, sys
import PIL.Image
#------------------------------------------------#
# S3 settings. #
#------------------------------------------------#
# Set S3_ZOOM_BUCKET to bucket name where zoom files should be stored
S3_ZOOM_BUCKET = 'zoom-zoom'
#--------... | null | config.py | config.py | py | 1,091 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.Image",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "PIL.Image.Image",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"... |
652566442 | import datetime
from django.test import TestCase
from django.utils import timezone
from django.urls import reverse
from django.test import TestCase
from .models import Question
class QuestionMethodTests(TestCase):
def test_was_pusblished_recently_with_future_question(self):
"""
was_published_rece... | null | polls/tests.py | tests.py | py | 4,914 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "... |
555691104 | '''
Matching base class.
'''
# built-in
import os
# libs
import matplotlib.pyplot as plt
import numpy as np
import cv2
__authors__ = "Gonçalo Ferreira, Gonçalo Adolfo, Frederico Costa"
__email__ = "a43779@alunos.isel.pt, goncaloadolfo20@gmail.com, fredcosta.uni@gmail.com"
FEATURES_NAME = ["area", "hue histogram"]
MA... | null | 03_Implementacao/PythonAlgs/src/matching_system/matcher.py | matcher.py | py | 12,255 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.resize",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number":... |
112734933 | from math import *
import numpy as np
import cv2
# Filters
# approximation
g_analysis = np.array([1, 1])/2
g_synthesis = np.array([1, 1])
# Detail
h_analysis = np.array([-1, 1])/2
h_synthesis = np.array([1, -1])
# DWT funcs
def analysis(x, f):
y = np.zeros(len(x)//2)
for n in range(len(y)):
y[n] = x[... | null | Image segmentation/BEP_4/dwt2d.py | dwt2d.py | py | 2,453 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11... |
648187435 | from django.core.management.base import BaseCommand
from django.conf import settings
from telegram import Bot, Update
from telegram.ext import CallbackContext, Filters, MessageHandler, Updater, CommandHandler
from telegram.utils.request import Request
from tga.models import Message, Profile
MAIN_ADMIN_ID = 602986718... | null | tga/management/commands/bot.py | bot.py | py | 5,524 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "telegram.Update",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "telegram.ext.CallbackContext",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "telegram.Update",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "telegram... |
384324799 | """ Primary email alert system for nol """
from email.mime.text import MIMEText
from subprocess import Popen, PIPE
from datetime import datetime
def send_email(msg):
now = datetime.now()
msg = MIMEText(msg)
msg["From"] = "deathnotices@michigan.com"
# msg["To"] = ', '.join([])
msg["Subject"] = "Dea... | null | mactive_importer/deathnotices/send_email.py | send_email.py | py | 740 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "subproc... |
91313967 | import os
from flask import Flask, render_template, request
from main import regressor
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/', methods=['POST'])
def userform():
loc = request.form['loc']
pqe = float(request.form['pqe'])
tier = request.... | null | webapp.py | webapp.py | py | 599 | 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",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.reques... |
649147755 | # -*- encoding: utf-8 -*-
import pygame
import animation
import resource
#import gamecontrol
import xml.dom.minidom
#Distinos estado que pueden tener los objetos del juego.
NORMAL, NOACTION, RUN, FORWARD, REVERSE, DAMAGED, ERASE, YAW = range(8)
class GameObject(pygame.sprite.Sprite):
'''
Clase "virtual pura... | null | branches/gameobject/gameobject.py | gameobject.py | py | 3,849 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.