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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
428228936 | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, get_list_or_404
from django.http import HttpResponseRedirect, Http404
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.utils import simplejson
from django.core.urlresolvers import reverse
from django.http import Http... | null | reproductions/views.py | views.py | py | 4,609 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "reproductions.models.Album.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "reproductions.models.Album.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "reproductions.models.Album",
"line_number": 16,
"usage_... |
213698032 | import pygame
import environmentGenerator
class block:
def __init__(self, pic, posx, posy):
self.pic = pygame.image.load("../Assets/img/" + pic + ".bmp").convert_alpha()
self.posx = posx
self.posy = posy
class scenery:
def __init__(self, pic, posx, posy):
self.pic = pygame.imag... | null | src/environment.py | environment.py | py | 3,442 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.image.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.image",
... |
485604978 | import requests
from bs4 import BeautifulSoup
import sys, os, re
def fetch(pageNum):
result = []
url = requests.get('https://ameblo.jp/wakeupgirls/page-{}.html'.format(pageNum)).text
soup = BeautifulSoup(url, 'html.parser')
for anchor in soup.findAll(rel='bookmark'):
entryURL = 'https:... | null | __main__.py | __main__.py | py | 2,417 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"li... |
220029519 | import pyglet
from pyglet.gl import *
from pyglet.window import key
import math
window = pyglet.window.Window(1300, 600, resizable=True, caption='Test')
radius = 50
height = 200
angle = 0
space = False
def draw_cone(radius=50, height=100):
glBegin(GL_TRIANGLE_FAN)
glVertex3f(0, height, 0)
for angle ... | null | OpenGL/test2.py | test2.py | py | 4,436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.window.Window",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pyglet.window",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "math.sin",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_n... |
608511788 | import random
import tkinter as tk
class Uniform(object):
"""Barebones example of a language model class."""
def __init__(self):
self.vocab = set()
def train(self, filename):
"""Train the model on a text file."""
for line in open(filename):
for w in line:
... | null | hw2/hw2-files/keyboard.py | keyboard.py | py | 3,888 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tkinter.Frame",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame.__init__",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "tkinter.... |
220795158 | from lxml import html
import os
import codecs
import requests
from bs4 import BeautifulSoup
from jianshu_scrawler.path.path_file import get_files_path_userid
def ReadDataFromHtmlFile(userid, articleid):
file_dir = get_files_path_userid(userid)
for filename in os.listdir(file_dir):
if filename.endswith... | null | jianshu_scrawler/jianshu_scrawler/files/read_html_file.py | read_html_file.py | py | 1,413 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "jianshu_scrawler.path.path_file.get_files_path_userid",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api... |
581103450 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 15 15:36:00 2021
@author: dell
"""
import pygame
pygame.init()
clock=pygame.time.Clock()
screen = pygame.display.set_mode((600,600))
pygame.display.set_caption("Asteroid")
background_image = pygame.image.load("bg2.jpg").convert()
BLUE=(0,0,255)
pl... | null | project.py | project.py | py | 1,299 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mod... |
387463366 | #
# -*- coding: utf8 -*-
from crypt import methods
from flask import Flask
# Importo mi formulario
from flask1 import formulario
#Para redenderizar el html con python, necesitamos la siguiente libreria
from flask import render_template
from flask import request
app = Flask(__name__)
# Al redenderizar le decimos que... | null | flask1/app_ini9Formulario.py | app_ini9Formulario.py | py | 1,218 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask1.formulario.CommentForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask1.formulario",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask.req... |
452005248 | __version__ = "0.0.1"
import json
import os
import boto3
from flask import Flask, request
from flask.ext.dotenv import DotEnv
from datetime import date, datetime
import pytz
app = Flask(__name__)
env = DotEnv()
env.init_app(app)
def boto_client(client):
boto_session = boto3.Session(
aws_access_key_id=app... | null | landlord/__init__.py | __init__.py | py | 2,818 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.ext.dotenv.DotEnv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "boto3.Session",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.date.today... |
127677832 | from django import template
register = template.Library()
@register.filter
def wikipedia(link):
import re
import urllib.parse
matches = re.match('.+wiki/(.+)', link)
if not matches:
return link
link = matches.group(1).replace('_', ' ')
link = urllib.parse.unquote_plus(l... | null | bussdatabase/templatetags/utils.py | utils.py | py | 343 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.parse.parse.unq... |
273572344 | import github
import requests
import lxml.etree
import bs4
import random
import string
from repository import Repository
from pprint import pprint
class GitHubAccount:
def __init__(self,mail,password):
self.mail = mail
self.password = password
self.user_session = requ... | null | login.py | login.py | py | 5,612 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lxml.etree.etree.HTML",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lxml.etree.et... |
452276505 | import pybullet as p
import os
import gibson2
import numpy as np
class YCBObject(object):
def __init__(self, name, scale=1):
self.filename = os.path.join(gibson2.assets_path, 'models', 'ycb', name,
'textured_simple.obj')
self.scale = scale
def load(self):
... | null | gibson2/core/physics/interactive_objects.py | interactive_objects.py | py | 6,378 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "gibson2.assets_path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pybullet.createCollis... |
37842553 | import redis
import time
def RLOG(rds):
logentry = rds.rpop('log')
return logentry, rds.hmget(logentry, 'k1', 'k2', 'k3')
rds = redis.Redis("localhost")
for i in range(1, 10):
print (RLOG(rds))
| null | readlog.py | readlog.py | py | 215 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "redis.Redis",
"line_number": 9,
"usage_type": "call"
}
] |
599814643 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | src/dms-preview/azext_dms/vendored_sdks/datamigration/models/validate_sync_migration_input_sql_server_task_output_py3.py | validate_sync_migration_input_sql_server_task_output_py3.py | py | 1,620 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
584281800 | """
Name:
Date:
Brief Project Description:
GitHub URL:
Testing
"""
from kivy.app import App
from kivy.lang import Builder
from item import Item
from itemlist import ItemList
from kivy.uix.button import Button
class ShoppingListApp(App):
def on_start(self): # this will do initialization
print("on_start is ... | null | main.py | main.py | py | 999 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kivy.app.App",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "kivy.uix.button.Button",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "kivy.uix.button.Button",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "kivy.lang.... |
521866295 | # Copyright 2014 Mirantis.inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | null | keystone/contrib/federation/migrate_repo/versions/003_mapping_id_nullable_false.py | 003_mapping_id_nullable_false.py | py | 1,423 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.T... |
155432840 | import matplotlib.pyplot as plt
import numpy as np
import numpy.polynomial.polynomial as poly
import math
def f(x):
return 1 / (1 + 25 * x ** 2)
a_x = np.linspace(-1, 1, 100)
a_y = [f(i) for i in a_x]
p = np.poly1d(poly.polyfit(a_x, a_y, 10)[::-1])
polyfit = [p(i) for i in a_x]
a_cx = [math.cos(math.pi * i / 10... | null | homework_5/problem_12.py | problem_12.py | py | 738 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.linspace",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.poly1d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.polynomial.polynomial.polyfit",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy... |
584703206 | from flask import Blueprint, request
from flask.views import MethodView
from flasky.validator import Validation as v
from flasky.shopping_cart.shopping_cart_model import AddToCart as cart
from flasky.response_helpers import response
shopping_cart_bp = Blueprint('shopping_cart', __name__, url_prefix='/api/v1')
clas... | null | flasky/shopping_cart/shopping_cart_view.py | shopping_cart_view.py | py | 1,705 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.views.MethodView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "flask.request.content_type",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": ... |
132684669 | """ABC
"""
import os
import openpyxl
import xlsxwriter
from firebase import firebase
class Filemanager:
"""Edite des fichiers de types TXT, XML ou MD
"""
def __init__(self, quote_lst):
self.quote_lst = quote_lst
def edit_txt_file(self):
"""Edite un fichier TXT avec les tags présents d... | null | classes/filemanager.py | filemanager.py | py | 3,621 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.stat",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number... |
394683670 |
import linkbot3
import json
import mysql.connector as sql
import os
import time
class Database() :
DB_NAME = "linkbot_diagnostics"
def __init__(self):
# See if the config file exists
try:
config_path = os.path.join(
os.environ['HOME'],
'.local',
... | null | linkbot_diagnostics/__init__.py | __init__.py | py | 4,798 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_numbe... |
51131945 | import pygame
import math
import time
from enum import Enum
class Status(Enum):
INACTIVE = 1
HOVER = 2
PUSHED = 3
class GButton:
def __init__(self, rect, colors, text = None, index = None, value = None, image = None, action = None):
self.rect = pygame.Rect(rect)
... | null | focus_utilities.py | focus_utilities.py | py | 6,431 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.Rect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.font.Font",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number"... |
354097389 | import requests
import copy
from requests.exceptions import *
from json.decoder import JSONDecodeError
SALT_API = {
"url": "http://192.168.88.103:8001",
"user": "saltapi",
"password": "saltapi",
}
class SaltApi(object):
def __init__(self):
self.timeout = 10
self.__user = SALT_API["us... | null | saltsatck/units/salts.py | salts.py | py | 6,610 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "copy.deepcopy",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "requests.packages",
"line_number": 36,
"usage_type": "attribute"
},
{
"a... |
310179398 | import itertools
import hashlib
def part1(input, start):
for i in itertools.count():
if hashlib.md5((input + str(i)).encode('utf-8')).hexdigest().startswith(start):
return i
assert part1('abcdef', "00000") == 609043
assert part1('pqrstuv', "00000") == 1048970
print(f'# Part 1: {part1("iwrup... | null | 2015/04/2015_04.py | 2015_04.py | py | 424 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.count",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 7,
"usage_type": "call"
}
] |
2653180 | import pygame, os, math
from pygame.locals import *
#Pour l'appli terminal
files = {'C:':{'dossier1':{'réinitialiser.exe':"réinit", 'dossier2':{}},'dossier3':{'fichier2':2, 'dossier4':{'fichier3':3, 'fichier4':4}}}}
g_path = ""
g_log = []
g_log.append("Username : [insérer énigme]")
g_ligne = 290
g_text = ""
#Pour l'a... | null | main.py | main.py | py | 18,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.draw.line",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.line",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
... |
152727817 | # This is a Python script. This scripts runs daily and find out the jobs
# to execute
import croniter
from datetime import datetime
import sys
from functions.sqlquery import sql_query, sql_query2
import logging
import pprint
LOGFILE = '.mainlog.log'
logging.basicConfig(filename=LOGFILE, level=logging.INFO)
def getne... | null | main.py | main.py | py | 6,197 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "croniter.is_valid",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.ERROR... |
134765006 | import numpy as np
import xarray as xr
airds = xr.tutorial.open_dataset("air_temperature").isel(time=slice(4), lon=slice(50))
airds.air.attrs["cell_measures"] = "area: cell_area"
airds.air.attrs["standard_name"] = "air_temperature"
airds.coords["cell_area"] = (
xr.DataArray(np.cos(airds.lat * np.pi / 180))
* x... | null | cf_xarray/datasets.py | datasets.py | py | 14,735 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "xarray.tutorial.open_dataset",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "xarray.tutorial",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "xarray.DataArray",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy... |
73978707 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from picamera import PiCamera#camera
from time import sleep
from datetime import datetime #date
import smtplib #mail
from email.mime.text import MIMEText
now = datetime.now()
print(now)
#camera
camera = PiCamera()
camera.start_preview()
camera.capture('camera/{}.jpg'.... | null | GUI/camera.py | camera.py | py | 732 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "picamera.PiCamera",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "smtplib.SMT... |
267179626 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="cdhtools",
version="2.2.0",
author="Stijn Kas",
author_email="stijn.kas@pega.com",
description="Open source tooling that helps Data Scientists working with CDH to analyze Pega models and c... | null | setup.py | setup.py | py | 1,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
625092485 | '''
Helper class that handle format related functionalities
'''
import re
import datetime
class FormatHelper ():
# strip method name
def stripmethodname(self, line):
index = line.find('(')
if line[index - 1] == ' ':
index -= 2
else:
index -= 1
i = inde... | null | server/python/FormatHelper.py | FormatHelper.py | py | 1,457 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "attribute"
}
] |
399574366 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import localflavor.us.models
class Migration(migrations.Migration):
dependencies = [
('nationalparks', '0006_auto_20150821_1406'),
]
operations = [
migrations.AlterField(
... | null | ekip/nationalparks/migrations/0007_auto_20150821_1508.py | 0007_auto_20150821_1508.py | py | 656 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 15,
"usage_type": "call"
},
{... |
535647389 | # Author: Anthony Cox
# Date: 29th June 2016
# Purpose: WebRenderer.py handles all of the web pages to be displayed in the application
import DataHandling;
import UIClasses
import UIConstants
import UIValidation
from flask import Flask, render_template, url_for, request, jsonify
app = F... | null | src/WebRenderer.py | WebRenderer.py | py | 10,755 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "UIConstants.BUDGET_PAGE_TITLE",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "UIConstants.BUDGET_PAGE_MENU_ID",
"line_number": 18,
"usage_type": "attribute"
},
{
... |
237497107 | import scrapy
class pekSpider(scrapy.spiders.Spider):
name = "pek1"
start_urls = [
"http://dean.pku.edu.cn/pkudean/course/kcb.php"
]
def parse(self, response):
# with open("peking-course-list.html",'w') as f:
# f.write(response.text)
# print("save successfully!... | null | go/go/spiders/peking-list.py | peking-list.py | py | 713 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.spiders",
"line_number": 3,
"usage_type": "attribute"
}
] |
508343869 | import requests
from django.shortcuts import render
from Information.models import City
def index(request):
bd_url = 'http://api.openweathermap.org/data/2.5/weather?id={}&units=Metric&APPID=fa836872108421842ef8bdbdee0d6d0e'
bd_r = requests.get(bd_url.format(1210997)).json()
bd_weather = {
'name':... | null | Weather/Information/views.py | views.py | py | 1,501 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Information.models.City.objects.all",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "Information.models.City.objects",
"line_number": 16,
"usage_type": "attribute"
},
{
... |
366324667 | import pygame
import random
import math
from time import sleep
DISP_WIDTH = 1000
DISP_HEIGHT = 500
BACKGROUND = (10, 10, 30)
pygame.init()
pygame.display.set_caption("Pong")
root = pygame.display.set_mode((DISP_WIDTH, DISP_HEIGHT))
root.fill(BACKGROUND)
done = False
font = pygame.font.Font('freesansbold.ttf', 300)
cl... | null | pong_single_player.pyw | pong_single_player.pyw | pyw | 7,936 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.dis... |
468907843 | from transformers import BertModel
from torch.nn import init
from .miscLayer import SimpleHidden
import os
import torch.nn.functional as F
import torch
import torch.nn as nn
from .BERT_Simple import BERT_Embedding
import math
import copy
def kld(mu, log_sigma):
"""log q(z) || log p(z).
mu: batch_size x dim
... | null | XSModelManager/models/CANTM.py | CANTM.py | py | 10,796 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.exp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_n... |
243246994 | import numpy as np
import os
import logging
logger = logging.getLogger(__name__)
from collections import OrderedDict
def global_noise(domain, seed=42, **kwargs):
"""
Create a field fielled with random noise of order 1. Modify seed to
get varying noise, keep seed the same to directly compare runs.
P... | null | logic/functions.py | functions.py | py | 2,344 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random.RandomState",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MP... |
632068219 | # Bad practice, but the warnings were getting annoying
import warnings
# Other imports
import numpy as np
from classifiers import knn, dtree
import random
import matplotlib.pyplot as plt
import time
warnings.filterwarnings("ignore")
class GA:
"""
Genetic algorithm class, includes methods
for crossover, m... | null | feature_selection/genetic_algorithm.py | genetic_algorithm.py | py | 14,371 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "numpy.r... |
375370900 | import json
import sys
import re
import spotipy
import spotipy.util as util
from pprint import pprint
from utils import saveFollowedArtists
from utils import getGenres
from utils import popRapCheck
def removeExtraFields(artist):
# Attributes to strip
fields_to_remove = [
'external_urls',
'fol... | null | pFinal/get-artists.py | get-artists.py | py | 4,191 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.getGenres",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "spotipy.util.prompt_for_user_tok... |
36522478 | from copy import deepcopy
from .edge_class import Edge
from .node_class import Node
from typing import Optional, Union, Dict
class Jelm:
"""jelm graph class
- stores and serializes a jelm graph
- has accessors for simple graph operations
- a lot of data is stored redundantly for speedups
"""
... | null | jelm/core/jelm_class.py | jelm_class.py | py | 4,662 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"li... |
103639044 | # coding:utf-8
__author__ = 'liangz14'
# coding:utf-8
import random
import math
import numpy as np
import scipy.io
import skimage.io
from scipy import misc
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import os
import bicubic_2d
from scipy.misc import imresize
from scipy.signal import convolve2d
def o... | null | toolgate/getpatchpair.py | getpatchpair.py | py | 4,705 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.min",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 24,
... |
390617691 | import cv2 as cv
import numpy as np
import dlib
# Download shape_predictor model
# http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
face_detector = dlib.get_frontal_face_detector()
face_predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')
cap = cv.VideoCapture(0)
index = list(ran... | null | dlib_face_landmark_detection_webcam.py | dlib_face_landmark_detection_webcam.py | py | 1,141 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv... |
294180445 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('arg',type = int)
args = parser.parse_args()
arg = args.arg
set3 = {1, 5, 6, 13, 4, 22}
print('min:', min(set3))
print('max:', max(set3))
print((arg > min(set3)) and (arg < max(set3))) | null | week3/set5.py | set5.py | py | 259 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
}
] |
523866671 | from PIL import Image
# Img resize:
# ant_size = 0.01
# ant_img = Image.open('imgs/ant.png')
# orig_ant_height, orig_ant_width = ant_img.size
# ant_img = ant_img.resize((round(orig_ant_width*ant_size),
# round(orig_ant_width*ant_size)))
# ant_img.save('imgs/small_ant.png')
# for spin in [45, 90, 13... | null | playground.py | playground.py | py | 607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 16,
"usage_type": "name"
}
] |
548998968 | from datetime import timedelta, datetime
import pendulum
import airflow
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
default_args = ... | null | dags/bb.py | bb.py | py | 1,542 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.today",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pendulum.today",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pendulum.tod... |
375054339 | #coding:utf-8
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from matplotlib.ticker import MultipleLocator
from skimage import io,data,morphology
from skimage import measure
from sklearn.cluster import KMeans
import numpy as np
import os,re
def segmentation(image):
cow,col = image.shape
... | null | example/yet.py | yet.py | py | 5,608 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 35... |
578359505 | #执行文件
import sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="gb18030")
from QCD.qcd_requests import qcd_requests#从当前文件夹下的含有请求模块的工作簿引入请求函数
from QCD.qcd_test_case import test_case#从当前文件夹下的含有测试数据函数的工作簿引入调用测试数据的函数
def run_write(file_name,sheet_name,row,column_1,column_2):
all_case=test_case(file_nam... | null | run.py | run.py | py | 2,097 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "QCD.qcd_test_case.test_case",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "QCD.qcd_req... |
51610845 | from core.prototypes.AbstractStorage import AbstractStorage
import json
from threading import RLock
class JSONStorage(AbstractStorage):
def __init__(self, path):
self.path = path
self.respdict = dict()
self.lock = RLock()
def put_responce(self, ip:'ipv4_str', port:'port', scan_result:... | null | modules/storage/JSONStorage.py | JSONStorage.py | py | 677 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "core.prototypes.AbstractStorage.AbstractStorage",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "threading.RLock",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
}
] |
625450001 | from bs4 import BeautifulSoup
import requests
POSTAVSHHIKI_URL = 'http://www.postavshhiki.ru/'
POSTAVSHHIKI_PRODUCTS_URL = 'http://www.postavshhiki.ru/katalog-postavshchikov/103-produkty-pitaniya'
def download_HTLM(url) -> BeautifulSoup:
html = requests.get(url)
html_text = html.text
soup = BeautifulSoup... | null | Postavshhiki/Postavshhiki_getter_adds.py | Postavshhiki_getter_adds.py | py | 1,013 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "name"
}
] |
487508958 | from bs4 import BeautifulSoup
from urllib.parse import urlencode
import requests
import os
import json
import re
from multiprocessing import Pool
MONGO_URL="localhost" # 链接地址
MONGO_DB="toutiao" # 数据库名称
MONGO_TABLE="toutiao" # 表名
# client=pymongo.MongoClient(MONGO_URL)
# db=client[MONGO_DB] # 数据库名称传... | null | 02ajax_json/今日头条街拍02.py | 今日头条街拍02.py | py | 4,588 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urlencode",
"l... |
321913587 | import os
import re
import pickle
import pandas as pd
import smtplib
from email.mime.base import MIMEBase
from email.mime.message import MIMEMessage
from email.mime.text import MIMEText
from email import encoders
from email.mime.multipart import MIMEMultipart
from decimal import Decimal
def iterate(inputs):
if i... | null | helper.py | helper.py | py | 7,657 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isdir",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 4... |
648939692 | '''
BDM-Based Negotiation Model
===========================
This model is based on the general framework proposed by BDM, and extended
elsewhere. The decision-free version of the model goes as follows:
Agents are characterized by cability, a position (on some issue; initially one
-dimensional), and the salience of th... | null | Predicting_Politics_Mesquita/Agents-In-Conflict-master/Code/bdm1/negotiation_model.py | negotiation_model.py | py | 8,586 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "staged_schedule.StagedActivation",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "mesa.datacollection.DataCollector",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 123,
"usage_type": "call"
},
{
... |
272914735 | #!/usr/bin/env python
import argparse
import common
name = 'scenario2'
operator_a_name = 'example-operator-a'
operator_a_namespace = name
operator_a_subscription = {
'name': operator_a_name,
'namespace': operator_a_namespace,
'channel': 'alpha',
'catalog_source': name
}
v1image = 'docker.io/djzager/ol... | null | scenario2.py | scenario2.py | py | 1,904 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.create_namespace",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "common.create_operator_group",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "common.create_catalog_source",
"line_number": 23,
"usage_type": "call"
},
{
... |
50943712 | import re
import sys
from pathlib import Path
from setuptools import find_packages, setup
here = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
def read_reqs(reqs_path: Path):
return re.findall(
r"(^[^#\n-][\w\[,\]]+[-~>=<.\w]*)", reqs_path.read_text(), re.MULTILINE
)
i... | null | packages/service-integration/setup.py | setup.py | py | 1,622 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number":... |
52383944 | # -*- coding: utf-8 -*-
"""
Created on Tue May 11 08:46:43 2021
@author: matth
"""
import numpy as np
# import matplotlib.pyplot as plt
# plt.plot(np.arange(10))
# plt.close()
import math
import torch
print(torch.__version__)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
#device = 'cpu... | null | CNNregression/CNNTrain.py | CNNTrain.py | py | 7,064 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.__version__",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.cud... |
191415929 | import cv2
# Filtering method for triangles
def triangle_area(triangle_poly):
area_txt = open('area.txt', 'w')
filtered = open('filtered_triangles.txt', 'w')
for i in range(0, len(triangle_poly) - 1):
triangle = triangle_poly[i]
lenght = []
lenght.append(pow((abs(triang... | null | triangle_detector.py | triangle_detector.py | py | 4,220 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "cv2.medianBlur",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "cv2.HoughCircles",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "cv2.HOUGH_GRADIENT",
"... |
140702782 | import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import Normalize
import set_paths
import conversions
import seaborn as sns
from matplotlib.ticker import MultipleLocator
# set paths
home_dir = os.path.expanduser("~")
project_dir = os.pat... | null | archive/plots_combined.py | plots_combined.py | py | 9,742 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.expanduser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
251664844 | import json
import logging
from django.conf import settings
from apps.dot_ext.models import get_application_counts, get_application_require_demographic_scopes_count
from apps.fhir.bluebutton.models import check_crosswalks
"""
Logger functions for logging module
"""
logger = logging.getLogger('audit.global_state_... | null | apps/logging/loggers.py | loggers.py | py | 1,317 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "apps.fhir.bluebutton.models.check_crosswalks",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "apps.dot_ext.models.get_application_counts",
"line_number": 19,
"usage_typ... |
294223252 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
from __future__ import unicode_literals
import os
import sys
import time
import json
import string
import requests
import argparse
import random
from subprocess import Popen, PIPE
import traceback
import multiprocessing
from decimal import Decimal, getcontext
#creator = 'z... | null | testcases/01_get_request.py | 01_get_request.py | py | 6,359 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line... |
261002577 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('petr', '0047_auto_20150129_1750'),
]
operations = [
migrations.AlterField(
model_name='consultin... | null | petr/migrations/0048_auto_20150130_0037.py | 0048_auto_20150130_0037.py | py | 900 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 15,
"usage_type": "call"
},
{... |
429744639 | """ drivers
"""
import numpy
import autofile
import mess_io
# New Libs
from lib.phydat import phycon
from lib.filesystem import orb as fsorb
from lib.filesystem import minc as fsmin
from routines.pf.messf import models as pfmodels
from routines.pf.messf import _tors as tors
from routines.pf.messf import _sym as sym
fr... | null | routines/pf/messf/blocks.py | blocks.py | py | 23,466 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "autofile.fs.theory",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "autofile.fs",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "routines.pf.messf._util.get_bnd_keys",
"line_number": 70,
"usage_type": "call"
},
{
"api_name... |
385623654 | import pyglet
import Resources
import Functions
import math
from pyglet.window import key
from pyglet.window import mouse
import random
global_key_handler = key.KeyStateHandler()
global_mouse_handler = mouse.MouseStateHandler()
class Camera(object):
def __init__(self, screen_width, screen_height):
se... | null | Objects.py | Objects.py | py | 3,857 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.window.key.KeyStateHandler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyglet.window.key",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pyglet.window.mouse.MouseStateHandler",
"line_number": 14,
"usage_type": "call"
},
... |
400186527 | import os
import warnings
import librosa
import markdown
import torch
from flask import Flask, render_template, request
from audio_model.audio_model.config.config import CommonVoiceModels
from audio_model.audio_model.pipeline_mananger import load_model
from audio_model.audio_model.utils import generate_pred, audio_mf... | null | commonvoice/api/app.py | app.py | py | 3,030 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "audio_model.audio_model.config.config.CommonVoiceModels.Country",
"line_number": 20,
"usage_type": "a... |
612727075 | import logging
import logging.config
config = """
[formatters]
keys=formatter1
[handlers]
keys=enter instance name for a handler object
[loggers]
keys=root
[formatter_formatter1]
format=%(asctime)s %(levelname)s %(message)s
[handler_enter instance name for a handler object]
class=StreamHandler
args=()
formatter=fo... | null | hyperskill_projects/hyperskill_logging_in_python/Configuration/fileConfig handlers/file_config_handlers.py | file_config_handlers.py | py | 729 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.config.fileConfig",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.config",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "logging.debug",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "logging.w... |
410311877 | #Phase 5
#Segment the corpus and calculate feedback attributes
import os
import json
import math
with open("RawF.json","r") as f_obj:
RawF = json.load(f_obj)
f_obj.close()
with open("Quality.json","r") as f_obj:
DicQ = json.load(f_obj)
f_obj.close()
with open("DocCorpus.json","r") as f_obj:
Corpus = json.load(f... | null | Segmentation.py | Segmentation.py | py | 4,031 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 20,
"... |
327442742 | from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.urls import reverse
from courses.models import Chapter, Run
from courses.settings import (
COURSES_ALLOW_SUBMISSION_TO_CHAPTERS,
COURSES_ALLOW_SUBMISSION_TO_LECTURES,
COURSES_DISPLAY_CHAPTER_D... | null | courses/utils.py | utils.py | py | 1,729 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "courses.models.Run",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 15,
"usage_type": "call"
... |
438585678 | from django.urls import path
from . import views
# include all of main app urls
urlpatterns = [
path('', views.main, name='main'),
path('create_person', views.create_person, name='create_person'),
path('delete_person/<person_id>', views.delete_person, name='delete_person'),
path('add_email/<person_id>/... | null | main/urls.py | urls.py | py | 813 | python | en | code | null | code-starcoder2 | 83 | [
{
"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",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
343195043 | # -*- coding: utf-8 -*-
'''
Story Database Object
=====================
'''
from __future__ import annotations
__all__ = ('Database',)
from typing import Any, Callable
from builder.datatypes.builderexception import BuilderError
from builder.objects.day import Day
from builder.objects.item import Item
from builder.o... | null | builder/datatypes/database.py | database.py | py | 8,607 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "builder.utils.logger.MyLogger.get_logger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "builder.utils.logger.MyLogger",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "builder.datatypes.builderexception.BuilderError",
"line_number": 34,
... |
531798231 | from django.shortcuts import render, redirect,render_to_response
from django.contrib.auth import login, authenticate, logout
from django.contrib.auth.forms import AuthenticationForm
from foro.forms import TopicoForm, Postform, ComentarioForm, Categoriaform, UserForm, PerfilForm,ModificarUserForm,ModificarDatosUserForm... | null | Views/Foro/views.py | views.py | py | 22,882 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.View",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.forms.AuthenticationForm",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 28,
"usage_type": "call"
},
{... |
608825348 | #!/usr/bin/env python
import website.bigfoot.models as models
from django.http import HttpResponse, HttpResponseRedirect
from website.bigfoot.utils import config, dataplus, siteaction, codejar_resume, statix, hotmetal
def handle(request):
myself = siteaction.getLoggedInUser(request, True)
if not myself:
... | null | website/bigfoot/views/me_createresume.py | me_createresume.py | py | 2,098 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "website.bigfoot.utils.siteaction.getLoggedInUser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "website.bigfoot.utils.siteaction",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 9,
"usa... |
79160648 | #!/usr/bin/python3
import discord, logging, traceback, os, datetime, time, sys, configparser, sqlite3, typing
from discord.ext import commands, tasks
from itertools import cycle
Config = configparser.ConfigParser()
Config.read(f".{os.path.sep}Config{os.path.sep}config.ini")
Prefix = []
Prefix.append(Config["Settings"... | null | Main.py | Main.py | py | 7,280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
385112176 | # -*- coding: utf-8 -*-
import collections
"""
Given two strings s and t , write a function to determine if t is an anagram of s.
You may assume the string contains only lowercase alphabets.
"""
def isAnagram1(s, t):
return sorted(s) == sorted(t)
def isAnagram2(s, t):
dict1, dict2 = {}, {}
for i in s:
... | null | leetcode/editor/practice/valid_anagram_242.py | valid_anagram_242.py | py | 905 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
}
] |
195058579 | import argparse
class StoreDictKeyPair(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
bf = {}
for kv in values.split(","):
k, v = kv.split("=")
bf[k] = v
setattr(namespace, self.dest, bf)
| null | utils.py | utils.py | py | 280 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.Action",
"line_number": 4,
"usage_type": "attribute"
}
] |
417941780 | import hashlib
import json
import requests
API_HOST = 'https://core.piastrix.com'
SECRETE_KEY = 'fK7OzcMxFFhytukwQPg7TVSd9'
SHOP_ID = '201543162558'
TRY_PATH = '/invoice/try'
def bill_try(order_id, amount, currency, description):
url = API_HOST + TRY_PATH
payload = dict()
payload['amount'] = amount
... | null | app/api.py | api.py | py | 1,321 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "hashlib.sha256",
"line_number": 47,
"usage_type": "call"
}
] |
410292795 | import discord
from discord.ext import commands
class Poll:
def __init__(self, client):
self.client = client
@commands.command(pass_context=True)
async def poll(self, ctx, question, *options: str):
if len(options) <= 1:
await self.client.say('You need more than one option to m... | null | cogs/poll.py | poll.py | py | 1,324 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.Embed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.command",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 9,
"usage_type": "name"
}
] |
410087507 |
# This python script takes in the price history dictionary from a pickle file.
# price_history[ticker]=[minute level opening price data]
# This estimates what profit we would get if we buy at particular percent from original price and sell at another percent of original price.
# The algorithm buys stock - It se... | null | Estimate_Profits_VaryAll3.py | Estimate_Profits_VaryAll3.py | py | 6,207 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 123,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 123,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
341026753 | import sys
# for importing helper classes
sys.path.append("..")
import socket
import pickle
from common.helper_classes import Job
import eval_cnn
HOST = '' # Symbolic name meaning all available interfaces
PORT = 4123 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socke... | null | worker/listener_jobs.py | listener_jobs.py | py | 712 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "socket.socket",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_... |
602010394 | from .add_root_path import *
from config.sql_config import *
import mysql.connector
from sqlalchemy import Column, String, create_engine, MetaData, Table
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from models.models import TransactionScanToBlock
import json
class Tr... | null | mapper/transaction_scan_to_block.py | transaction_scan_to_block.py | py | 1,883 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 17,
"usage_type": "call"
},
{
"api_name... |
308931027 | import numpy as np
import scipy.sparse as sp
# size of each block
block_m, block_n = 100, 20
# number of blocks
N = 100
# sparsity density of coupling blocks
p = 0.005 / N
# add blocks to the diagonal
diags = []
for i in xrange(N):
delta_m, delta_n = np.random.randint(
-0.1 * block_m, 0.1 * block_m), np... | null | random_cone_problem.py | random_cone_problem.py | py | 1,591 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.ran... |
382085287 | from typing import Any
import proto
class ListingGroupFilterProductTypeLevelEnum(proto.Message):
class ListingGroupFilterProductTypeLevel(proto.Enum):
UNSPECIFIED = 0
UNKNOWN = 1
LEVEL1 = 2
LEVEL2 = 3
LEVEL3 = 4
LEVEL4 = 5
LEVEL5 = 6
def __init__(
... | null | google-stubs/ads/googleads/v12/enums/types/listing_group_filter_product_type_level.pyi | listing_group_filter_product_type_level.pyi | pyi | 436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "proto.Message",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "proto.Enum",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 16,
"usage_type": "name"
}
] |
295412047 | import pandas as pd
from matplotlib import style
import numpy as np
import matplotlib.pyplot as plp
style.use('ggplot')
web_stats = {'Day': [1, 2, 3, 4, 5, 6],
'Visitors': [43, 53, 34, 45, 64, 34],
'Bounce_Rate': [65, 72, 62, 64, 54, 66]}
df = pd.DataFrame(web_stats)
df.set_index('Day', in... | null | Pandas/Pandas.py | Pandas.py | py | 541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.style.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
5116722 | import numpy as np
from abc import ABC
import gym
from gym import spaces
from utils_main import save_files
import time
from trajectory import Trajectory
from ctrl import Control
from quadFiles.quad import Quadcopter
from utils.windModel import Wind
import utils
import config
from run_3D_simulation import main, quad_sim... | null | custom_gym/envs/custom_env_dir/custom_env.py | custom_env.py | py | 14,998 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gym.Env",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 53,... |
105712401 | import argparse
import os
import sys
import tensorflow as tf
import yaml
from Models.lstm.fwbw_lstm_supervisor import FwbwLstmRegression
print(tf.__version__)
if tf.__version__ != '2.0.0':
config_gpu = tf.ConfigProto()
config_gpu.gpu_options.allow_growth = True
session = tf.Session(config=config_gpu)
d... | null | run_fwbw_lstm.py | run_fwbw_lstm.py | py | 4,611 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.__version__",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.__version__",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 12,
"usage_type": "call"
},
{
"ap... |
502466176 | #Configuration 추가. default값 바꾸는 코드
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataroot', default='C:\\Users\JINI\workspace\DeepLearning\PROGRAPHY DATA', help='path to dataset')
# hyper-parameters
"""
epochs = 10 // epochs는 서버에서 돌려보고 조절.
learning_rate = 0.0002
"""
parser.add_argument('... | null | Tekken_highlighting/config.py | config.py | py | 1,461 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
}
] |
14907567 | import wandb
import numpy as np
import sys
import numpy as np
from problems import SimpleGaussian
from treeQuadrature import Container
from treeQuadrature.splits import kdSplit, minSseSplit
from treeQuadrature.containerIntegration import midpointIntegral, randomIntegral
from treeQuadrature.visualisation import plotCon... | null | results/activeIntegrator.py | activeIntegrator.py | py | 4,702 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.choice",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "treeQuadrature.Container",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "numpy.... |
202652396 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import project.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | null | api/project/migrations/0001_initial.py | 0001_initial.py | py | 6,952 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.swappable_dependency",
"line_number": 12,
"usage_type": "call... |
621669919 | import piradio.fonts as fonts
import piradio.graphics as graphics
import piradio.ui as ui
import piradio.lcd as lcd
import piradio.services as services
import piradio.config as config
from piradio.config import CONFIG
from piradio.panels import *
import logging
import os
import time
UPDATE_RATE = float(config.get('up... | null | piradio/app.py | app.py | py | 6,706 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "piradio.config.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "piradio.config",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_num... |
377994517 | # coding: utf-8
#
# BSD 3-Clause License
#
# Copyright (c) 2017 xxxx
# All rights reserved.
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source c... | null | PyTorch/dev/cv/image_classification/coral-cnn_ID1064_for_PyTorch/model-code/morph-ordinal.py | morph-ordinal.py | py | 17,034 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getenv",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "torch.npu.current_device",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "torch.npu",
"line_nu... |
256438255 | # -*- coding: utf-8 -*-
from .models import Task
from django.forms import ModelForm, TextInput, Textarea
class CreateTaskForm(ModelForm):
class Meta:
model = Task
fields = ["title", "task"]
widgets = {
"title": TextInput(attrs={
"class": "form-control",
... | null | taskmanager/main/forms.py | forms.py | py | 558 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Task",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.TextInput",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.forms.... |
239501042 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 17 21:45:19 2019
@author: salihemredevrim
"""
import re
import pandas as pd
import matplotlib.pyplot as plt
import spacy
from collections import Counter
from wordcloud import WordCloud
#%%
data_class = pd.read_excel('data_class.xlsx')
#data_ner =... | null | vol_3/MM_ner_pos_wordclouds.py | MM_ner_pos_wordclouds.py | py | 9,812 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_excel",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_numb... |
594456340 | import os
import sys
import numpy as np
import scipy.io
import scipy.misc
import tensorflow as tf
import matplotlib.pyplot as plt
IMAGE_WIDTH = 800
IMAGE_HEIGHT = 600
COLOR_CHANNELS = 3
#噪音比
NOISE_RATIO = 0.6
#不断更加重视内容损失
BETA = 5
#不断更重视风格损失
ALPHA = 100
MEAN_VALUES = np.array([123.68, 116.779, 103.939]).reshape((1,1,1... | null | testProject/machine_learning/styleMove.py | styleMove.py | py | 6,608 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.io.io.loadmat",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line... |
356413592 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.gridspec as gridspec
import numpy as np
import math
import warnings
import gc
import os
from .baseimage import PETImage, SubImage
class ImageEditor:
def __init__(self, image=None, collapse='sum', escale=1.0):
self.image = im... | null | src/imgclasses/imageviewer.py | imageviewer.py | py | 19,778 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "baseimage.SubImage",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "gc.collect",
"line_n... |
156053133 | from pathlib import Path
import subprocess
from datalad.api import (
create,
)
from datalad.tests.utils import (
with_tempfile,
assert_repo_status,
eq_,
)
from ria_remote.tests.utils import (
initremote,
initexternalremote,
setup_archive_remote,
populate_dataset,
get_all_files,
... | null | ria_remote/tests/test_basics.py | test_basics.py | py | 1,970 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datalad.api.create",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "ria_remote.tests.utils.setup_archive_remote",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "ria_remote.tests.utils.populate_dataset",
"line_number": 28,
"usage_type":... |
119616004 | import torch
import torch.utils.data
from model import CNN
from utils import Utils
from torch import optim
from tqdm import tqdm
from datetime import datetime
def trainLoop(cnn: CNN, ut: Utils, shouldSave=False):
criterion = ut.tripletLoss
if ut.optim == "SGD":
optimizer = optim.SGD(cnn.parameters(), ... | null | main.py | main.py | py | 3,433 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "model.CNN",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.Utils",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.optim.SGD",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number"... |
118133595 | """
MIT License
Copyright (c) 2019 Yoann Berenguer
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, modify, merge... | null | test_bloom.py | test_bloom.py | py | 4,499 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.init",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.... |
271219242 | from OAI_modbus import OAI_Modbus
import time
import struct
import json
class UartStruct:
def __init__(self, **kwargs):
self.receive_struct_addr = kwargs.get('receive_struct_addr', 14)
self.write_ptr_addr = self.receive_struct_addr + 3
self.receive_data_addr = self.receive_struct_addr + 4
... | null | oai_kpa_interface.py | oai_kpa_interface.py | py | 6,481 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "OAI_modbus.OAI_Modbus",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"lin... |
624104278 | import glob
from scipy.ndimage import imread
import numpy as np
for size in ['small', 'large']:
print('Converting notMNIST_%s dataset into numpy arrays' % size)
dirs = glob.glob('notMNIST_%s/*' % size)
data = np.zeros((0, 28, 28))
labels = np.zeros((0,))
for d in dirs:
images = glob.glob... | null | preprocess.py | preprocess.py | py | 1,137 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 14,
... |
411779543 | from flair.data import Sentence
from flair.models import SequenceTagger
from flair.embeddings import FlairEmbeddings, BertEmbeddings
import flair
import pandas as pd
import random
import numpy as np
import tensorflow as tf
from keras.layers import Input, Dense, Flatten, LSTM, Concatenate, concatenate,Reshape, multiply,... | null | Attention/bert.py | bert.py | py | 8,410 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flair.embeddings.BertEmbeddings",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "flair.embeddings",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "keras.backend.function",
"line_number": 39,
"usage_type": "call"
},
{
"api_... |
158633658 | '''acorr_ljungbox(x, lags=None, boxpierce=False)函数检验无自相关
lags为延迟期数,若为None则输出min((nobs // 2 - 2), 40),其中nobs为观测样本数量,样本较大的情况下输出40
boxpierce为True时表示除开返回LB统计量还会返回Box和Pierce的Q统计量
返回值:
lbvalue:测试的统计量
pvalue:基于卡方分布的p统计量
bpvalue:((optionsal), float or array) – test statistic for Box-Pierce test
bppvalue:((optional), float or a... | null | whiteNoiseRecognize.py | whiteNoiseRecognize.py | py | 886 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "statsmodels.stats.diagnostic.acorr_ljungbox",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.np.random.normal",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.np.random",
"line_number": 18,
"usage_type": "attribute"
},
... |
94951146 | import pytest
from essentials_kit_management.storages.order_storage_implementation \
import OrderStorageImplementation
from essentials_kit_management.interactors.storages.dtos import (
UpdateFormNewOrderDto, UpdateFormOrderDto
)
from essentials_kit_management.models import Order
@pytest.mark.django_db
d... | null | essentials_kit_management/tests/storages/test_update_form/test_update_orders.py | test_update_orders.py | py | 1,610 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "essentials_kit_management.interactors.storages.dtos.UpdateFormOrderDto",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "essentials_kit_management.interactors.storages.dtos.UpdateFormOrderDto",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ess... |
42301510 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 11 16:19:58 2019
@author: Cumali
"""
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import confusion_matrix
from sklearn.li... | null | Machine Learninh with Python/26pca.py | 26pca.py | py | 1,627 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 30,
"usage_type": "call"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.