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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
110287012 | from collections import defaultdict, OrderedDict
if __name__ == "__main__":
index = defaultdict(OrderedDict)
for ndx in range(4):
temp_index = dict()
with open("temp_index_" + str(ndx) + ".txt") as iFile:
temp_index = eval(iFile.read()[11:].replace("<class 'collections.OrderedDic... | null | Project3/merger.py | merger.py | py | 508 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 7,
"usage_type": "argument"
}
] |
631288302 | # USAGE
# python build_dataset.py
# import necessary packages
import config
from imutils import paths
import numpy as np
import shutil
import os
def copy_images(imagePaths, folder):
# check if the destination folder exists and if not create it
if not os.path.exists(folder):
os.makedirs(folder)
# ... | null | build_dataset.py | build_dataset.py | py | 1,595 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
489397740 | # -*- coding: utf-8 -*-
import base64
import imghdr
import json
import logging
import os
from odoo import fields, models, api, tools, _
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
class MusicFolder(models.Model):
_name = 'oomusic.folder'
_description = 'Music Folder'
_or... | null | models/oomusic_folder.py | oomusic_folder.py | py | 12,233 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "odoo.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char... |
444246658 | #!/usr/bin/python3
"""Amenities view - module"""
from api.v1.views import app_views
from flask import jsonify, request, abort
from models import storage
from models.amenity import Amenity
@app_views.route("/amenities", methods=["GET"],
strict_slashes=False)
def amenities_get():
"""Function that r... | null | api/v1/views/amenities.py | amenities.py | py | 2,616 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.storage.all",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.amenity.Amenity",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "models.storage",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.js... |
507778887 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "single_sign.settings")
django.setup()
import pymssql as sql
import datetime
from django.utils.timezone import now
from leave.models import Apply
from workflow.models import ... | null | jiaoben.py | jiaoben.py | py | 4,167 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ.setdefault",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pymssql.connect",
... |
484118016 | import abc
import json
import csv
import re
import os
import requests
class NLDefiner:
"""
Abstract class for determining whether an annotation in the dataset is a natural language (NL) mention.
Subclasses that inherit this class should:
* Be named [Name]NLDefiner
* Implement the abstract method de... | null | nala/preprocessing/definers.py | definers.py | py | 5,950 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "abc.abstractmethod",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_... |
332237925 | from stack import get_time_running, get_latest, record_audio, set_running, get_press, clear_press
import threading
from time import sleep, time
import pygame, sys
from helper import round_id, comp_id
from picamera import PiCamera
from PIL import Image
import io
import zbarlight
import requests
def makeTime(time,penalty... | null | python/solo/display_only2.py | display_only2.py | py | 6,523 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 16,
... |
177795102 | import os
from urllib.parse import urlparse
import asyncio
import aiohttp
import async_timeout
import aiofiles
import motor.motor_asyncio
from PIL import Image
HTTP_TIMEOUT = 10
IMAGE_DIR = './images/'
MONGO_DB = 'images'
MONGO_COLLECTION = 'downloaded'
def get_name(url):
path = urlparse(url).path
return os.... | null | pure/get_images.py | get_images.py | py | 2,097 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.parse.urlparse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "async_timeout.tim... |
415409170 | from flask import request, jsonify, render_template
from app.config import IMAGE_DOMAIN
from app.models.user_score import UserScore
from app.models.user_total_score import UserTotalScore
from app.view_models.counter import Counter
from app.web import web, cache_with_param
from app.view_models.refresh import RefreshCon... | null | app/web/wx_mini.py | wx_mini.py | py | 7,130 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.view_models.login.LoginController",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 22,
"usage_type": "name"
},
{
"api... |
217777508 | try:
import benchmark_pb2, benchmark_pb2_grpc
except:
from . import benchmark_pb2, benchmark_pb2_grpc
import pickle
from concurrent import futures
import torch
from torch import Tensor
import torch.nn as nn
import grpc
from threading import Lock
import os
import numpy as np
from .common import (
identity,... | null | benchmark/grpc_server.py | grpc_server.py | py | 7,692 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.identity",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "common.identity_script",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "common.heavy",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "common.heavy_scri... |
561910839 | from django.contrib.auth import views as auth_views
from django.urls import path
from . import views
app_name='sns'
urlpatterns=[
path('',views.index,name='index'),
path('<int:page>',views.index,name='index'),
path('groups',views.groups,name='groups'),
path('add',views.add,name='add'),
path('create... | null | sns/urls.py | urls.py | py | 667 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
521787792 | # COVID-19 Simulation;
import numpy as np
from scipy.integrate import odeint
from scipy.stats import chisquare
import matplotlib.pyplot as plt
from matplotlib import dates as mpl_dates
import pandas as pd
import datetime
N=100000 #population
g = 1/15. #incubation time
R0_test = 4.0 #number of transmission per per... | null | covid.py | covid.py | py | 3,988 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.date",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line... |
531343557 | # -*- coding: utf-8 -*-
"""
Description:celery 配置
"""
from kombu import Exchange, Queue
from celery import platforms
platforms.C_FORCE_ROOT = True
BROKER_URL = 'amqp://'
CELERY_RESULT_BACKEND = 'amqp://'
CELERY_TASK_SERIALIZER = 'msgpack' # 任务序列化和反序列化使用msgpack方案
CELERY_RESULT_SERIALIZER = 'json' # 读取任务结果一般性能要求不... | null | platform/strategy/celeryconfig.py | celeryconfig.py | py | 900 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "celery.platforms.C_FORCE_ROOT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "celery.platforms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "kombu.Queue",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "kombu.E... |
231606004 | """
Handle vibrational data info
"""
import os
import projrot_io
import autofile
from lib.phydat import phycon
from lib.submission import run_script
from lib.submission import DEFAULT_SCRIPT_DCT
def projrot_freqs_1(tors_geo, hess,
proj_rotors_str,
save_path, pot=False, saddl... | null | routines/pf/messf/_vib.py | _vib.py | py | 3,851 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "projrot_io.writer.rpht_input",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "projrot_io.writer",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "autofile.fs.build",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": ... |
462300301 | import os
import cv2
import time
import argparse
import torch
import warnings
import numpy as np
from PIL import Image
from detector import tensorflow_detection_tf2, load_model_in_gpu
from deep_sort import build_deepsort_tracker
from custom_sort import build_sort_tracker
from utils.draw import custom_draw
from utils.p... | null | rcnn_deepsort.py | rcnn_deepsort.py | py | 7,125 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.log.get_logger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "warnings... |
210776689 | import csv
import argparse
import sys
import os
parser = argparse.ArgumentParser(description = 'Mismatch writer for Bert')
parser.add_argument('--data_dir', type=str, required=True, help='Data directory')
parser.add_argument('--output_dir', type=str, required=True, help='Output directory')
def main():
parsed = pa... | null | examples/adversarial/mismatch_writer.py | mismatch_writer.py | py | 1,515 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line... |
451018267 | #! /usr/local/bin/python
import cv2
import numpy as np
import sys
params = sys.argv
img = cv2.imread(params[1])
cv2.line(img,(0,0),(100,100),(255,0,0),5)
cv2.rectangle(img,(50,20),(100,40),(0,255,0),3)
cv2.imshow('result',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
| null | bin/HighGUI.py | HighGUI.py | py | 270 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.line",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 11... |
275624018 | from setuptools import setup
version = '1.0.2'
install_requires = [
'click',
'boto3',
'tabulate',
]
setup(name='cf_upgrade',
version=version,
description='Trivial AWS CloudFormation updater',
long_description=open('README.rst').read() + '\n' +
open('CHANGES.rst').read(),
... | null | setup.py | setup.py | py | 1,006 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
}
] |
190349342 | import pymongo
import settings
class ModuleBase:
def __init__(self):
self.conn_mongo = pymongo.MongoClient(host=settings.mongo_host)
self.db = self.conn_mongo[settings.mongo_db]
class UserInfo(ModuleBase):
def __init__(self):
super().__init__()
self.table = self.db[settings.u... | null | modules/users.py | users.py | py | 1,570 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "settings.mongo_host",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "settings.mongo_db",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sett... |
107837703 | from Crypto.Cipher import AES
import requests
import base64
import json
import re
class Get_lyric(object):
def __init__(self,songid):
self.songid=songid
self.first_param = "{\"id\":\"" + songid + "\",\"lv\":-1,\"tv\":-1,\"csrf_token\":\"\"}"
self.second_param = "010001"
self.forth_p... | null | misuci163/Get_Lyric.py | Get_Lyric.py | py | 2,381 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Crypto.Cipher.AES.new",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "Crypto.Cipher.AES",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "Crypto.Cipher.AES.MODE_CBC",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name"... |
561584336 | from django.core.management.base import BaseCommand
from django.utils import timezone
from ...models import TrackingSetting
from ...chain_db_functions import update_seedpool_holders_tables
class Command(BaseCommand):
help = 'Update Seed Pool v2 holders tables'
def add_arguments(self, parser):
# mand... | null | govvault/management/commands/update_seedpool_holders_tables.py | update_seedpool_holders_tables.py | py | 1,346 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.TrackingSetting.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "models.TrackingSetting",
"line_number": 24,
"usage_type": "name"
},
... |
636143557 | from collections import defaultdict
# O(n) time and space complexity
def group_students_by_age(all_students):
grouped = defaultdict(lambda: [])
for student in all_students:
_name, age = student
grouped[age].append(student)
return [student for students in grouped.values() for student in students]
# O(n)... | null | py/group_students_by_age.py | group_students_by_age.py | py | 1,874 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 14,
"usage_type": "call"
}
] |
536401293 | #!/usr/bin/env python3
from mbp_client import MBPclient # for connecting to the MBP
from mbp_analog_reader import AnalogInputReader # for reading analog sensor data
import sys, json, time
DEFAULT_INTERVAL_FOR_SENDING_DATA = 30 # default interval for sending (seconds)
DEFAULT_CHANNEL = 2 # default channel where sensor... | null | resources/operators/extraction/LK-light_raspberry-pi/LK-light_raspberry-pi.py | LK-light_raspberry-pi.py | py | 1,216 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mbp_client.MBPclient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "mbp_analog_reader.AnalogInputReader",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "t... |
523817444 | # -*- coding: utf-8 -*-
import json
__author__ = 'seb'
from models import LogEntry, db_session
from sqlalchemy import func
import os
import re
def create_db():
#
try:
# load file into dictionary
# data = open('example.log')
line_re = re.compile(r'^([^\s]+)\s([^\s]+)\s([^\s]+)\s\[([^\... | null | createdb.py | createdb.py | py | 2,845 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "models.LogEntry",
"line_numb... |
312166459 | import random
import argparse
import json
import time
import numpy as np
import tweepy
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# argparse
parser = argparse.ArgumentParser(description='construct and save word predicting model')
parser.add_argument("input"... | null | twitter_rnn.py | twitter_rnn.py | py | 5,836 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available... |
256480444 | import requests # 웹상의 웹페이지를 다운로드하는 역할,소스보기 했을때 나오는 코드를 다운로드 하는 라이브러리
from bs4 import BeautifulSoup
import json#ajax를 위한 데이터 형식. dictionary format
#서버로부터 웹페이지가 반환되면 화면 전체를 갱신해야 하는데 페이지 일부만을 갱신하고도 동일한 효과를 볼 수 있도록 하는 것이 Ajax
import geohash2
#pip install bs4
#pip install requests
#pip install geohash2
#pip install pprint... | null | Lect/크롤링/bang.py | bang.py | py | 4,140 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "geohash2.encode",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_n... |
615134284 | #!/usr/bin/env python
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.escape
import tornado.template
import tornado.autoreload
from tornado.process import cpu_count
from tornado.options import define, options
from utils import *
from handlers import *
import t... | null | tornado/web/Web.py | Web.py | py | 2,491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tornado.options.define",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tornado.options.define",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tornado.httpserver.web",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_nam... |
553637960 | from PIL import Image
# 读取图片
image_1 = Image.open('./素材/壁纸.jpg')
print(image_1.size)
print(image_1.mode)
# show的标准版本效率不高,因为它将图像保存到临时文件并调用xv工具显示图像。
# 如果你没有安装xv,它甚至不会工作。 它对于调试和测试非常方便。
image_1.show()
# 图像的颜色转换
# 常见模式为灰度图像为“L”(亮度),真彩色图像为“RGB”,印刷四色为“CMYK”。
image_2 = Image.open('./素材/壁纸.jpg').convert('L')
# 图像的保存
image_2.sa... | null | PIL_test.py | PIL_test.py | py | 1,685 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": ... |
643112148 | import numpy as np
import matplotlib.pylab as plt
from random import randint
import random
rlist = []
rules = []
for i in range(256):
#a = randint(0,255)
rules.append(i)
for rule in rules:
l = bin(rule)[2:]
dif = 8 - len(l)
padding = '0' * dif
l = padding + l
l = l[::-1] #reversing
rlist.append(l)
prob_1 = {... | null | Probabilistic-CA/test.py | test.py | py | 3,358 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.randint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 134,
"usage_type": "call"
},
{
"api_name": "numpy.matrix",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "matplotlib.pylab.figure",... |
185121786 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 作者:2019/8/15 by jade
# 邮箱:jadehh@live.com
# 描述:TODO
# 最近修改:2019/8/15 下午2:05 modify by jade
import tensorflow as tf
_R_MEAN = 123.68
_G_MEAN = 116.78
_B_MEAN = 103.84
_RESIZE_SIDE_MIN = 256
_RESIZE_SIZE_MAX = 512
def _crop(image,offset_height,offset_width,crop_heigh... | null | datasetopeation/image_processing/ssd_processing.py | ssd_processing.py | py | 8,235 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.shape",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tensorflow.Assert",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "tensorflow.equal",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.rank",... |
614559285 | # import xlrd
import os,sys
import pandas as pd
def get_input_excel(excel_file_name, developer_mode=False):
"""
:param excel_file_name: name of the uploaded excel file
:return: names along with the defect IDS
"""
loc = excel_file_name
# To open Workbook
wb = xlrd.open_workbook(loc)
sheet = wb.sh... | null | Freelancing_codes/Excel/Excel_merging.py | Excel_merging.py | py | 6,049 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdout.write",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.write",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"l... |
346953074 | from typing import Dict
import argparse
import logging
#from allennlp.commands.elmo import Elmo
from allennlp.commands.evaluate import Evaluate
#from allennlp.commands.fine_tune import FineTune
#from allennlp.commands.make_vocab import MakeVocab
from allennlp.commands.predict import Predict
#from allennlp.com... | null | allennlp/commands/__init__.py | __init__.py | py | 2,406 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "allennlp.commands.subcommand.Subcommand",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": ... |
69056001 | import sys
import numpy as np
import matplotlib.pyplot as plt
import h5py
from scipy.interpolate import interp1d, griddata
from scipy.fftpack import fft, fftfreq
import numpy.polynomial.polynomial as poly
from polp_new import get_metric, get_dx_dxp
from coord_transforms import get_ginverse, transform_gcon, transform_... | null | python_scripts/mode_analysis.py | mode_analysis.py | py | 15,170 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.sum",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 23,
... |
444126173 | import json
import pandas as pd
from selftf.lib.common import PSTunerTrainingData, PSTunerConfiguration, \
PSTunerTrainingDataSerializer
PATH_SOURCE = "cnn_baseline_history.csv"
PATH_DST = "cnn_history.csv"
NUM_MACHINE = 36
NUM_THREAD = 16
workloads = ["cnn", "svm", "lr"]
def generate(workload):
PATH_SOURC... | null | test/mltuner/generate_history.py | generate_history.py | py | 1,226 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selftf.lib.common.PSTunerConfiguration",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "selftf.lib.common.PSTunerTrainingData",
"line_number": 30,
"usage_type": "call"
... |
593387757 | from flask import Flask, url_for, redirect, request, render_template, flash, current_app
import os
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
import time
import datetime
basedir = os.path.abspath(os.path.dirname(__file__))
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = '... | null | app.py | app.py | py | 8,388 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_num... |
642987687 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import connection
from django.db import models
from django.db.models.signals import post_save, post_delete
from django.core.cache import cache
from django.dispatch import receiver
from apps import dictfetchall
from apps.worke... | null | apps/banners/models.py | models.py | py | 5,351 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.db.models.SlugField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name"... |
353185801 | """
Draft: 2020-06-24/MS
"""
from pathlib import Path
import os
import subprocess
import json
import shutil
class Exiftool:
"""Class for embedding and retrieving any metadata
from a single image file up to all image files in hierarchy of folders"""
filetypes = (".jpg", ".jpeg", ".tif", ".tiff", ".psd... | null | scripts/pmdtools/exiftool.py | exiftool.py | py | 5,646 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number"... |
251777261 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('devilry_group', '0015_auto_20160111_1245'),
]
operations = [
migrations.AlterField(
model_name='feedbackset',
... | null | devilry/devilry_group/migrations/0016_auto_20160114_2202.py | 0016_auto_20160114_2202.py | py | 1,435 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
459873008 | # This code dumps ner dataset for this sequence tagger.
# Details are here: https://www.kaggle.com/abhinavwalia95/entity-annotated-corpus
#
# 1. You download csv file from the project.
# (1.5) I change the file encode to solve an error on loading binary format csv.
# 2. Run this code with the csv file.
# ```python3... | null | misc/dump_kaggle-GMB-ner.py | dump_kaggle-GMB-ner.py | py | 2,718 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DEBU... |
120674513 | import pygame
SIZE = [800,600]
BLACK = [0,0,0]
BLUE = [0, 0, 255]
class Paddle(pygame.sprite.Sprite):
def __init__(self, picture, num, x, y):
super().__init__()
self.surface = pygame.image.load(picture).convert()
self.surface = pygame.transform.scale(self.surface,[30,100])
self.faceup = self.surface
... | null | pong/config.py | config.py | py | 1,767 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.... |
275148313 | import plotly.offline as pyo
import plotly.graph_objs as go
import pandas as pd
df = pd.read_csv('../Datasets/Weather2014-15.csv')
data = [go.Heatmap(x=df['month'],
y=df['day'],
z=df['actual_max_temp'].values.tolist(),
colorscale='Jet')]
layout = go.Layout(tit... | null | Group/WeatherHeatMap.py | WeatherHeatMap.py | py | 478 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs.Heatmap",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "plotly.graph... |
189921236 | from rest_framework import status
from rest_framework.test import APIClient
from django.test import TestCase
from reapp.models import EstateOffer, User
from api.v1.serializers import (
PublicEstateOfferSerializer,
AgentEstateOfferSerializer
)
from .mock_data import (
CUSTOMER_USER_1,
AGENT_USER_1,
... | null | real-estate-server/reapp/tests/test_views.py | test_views.py | py | 8,666 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.test.APIClient",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "reapp.models.User.objects.create",
"line_number": 30,
"usage_type": "call"
},
{
... |
249593360 | import os
import qrcode
from functools import wraps
import datetime
from flask import render_template, flash, redirect, request, url_for, jsonify
from app import app, db, api
from app.models import User, Staff, BlacklistToken, Registrations, OtherPurchases
from app.mail import farer_welcome_mail, passkey_mail
from conf... | null | app/farer.py | farer.py | py | 25,615 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.api.namespace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "app.api",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "flask.request.headers.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.request.hea... |
616604842 | import torch
from torch import nn
import os
from torch import optim
import numpy as np
import pickle
from smpl_torch_batch import SMPLModel
from torch.utils.data import Dataset, DataLoader
from sys import platform
class Joint2SMPLDataset(Dataset):
'''
Regression Data with Joint and Theta, Beta.
Pre... | null | train_acos_regressor_24_joints.py | train_acos_regressor_24_joints.py | py | 9,965 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
... |
39828941 | from django.db import models
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.utils.translation import ugettext_lazy as _
from django.conf import settings... | null | qrelation/qrelation/models.py | models.py | py | 2,907 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Manager",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "django.db.models.Model",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_na... |
211643907 | #!/usr/bin/env python3
from gi import require_version
require_version( "Gtk", "3.0" )
from os import walk
from subprocess import Popen, call
import os.path #fetch filenames
#making sure it uses v3.0
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
from gi.repository.GdkPixbuf import Pixbuf
from data.colorparser imp... | null | src/wpg.py | wpg.py | py | 18,753 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gi.require_version",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gi.repository.GLib.get_home_dir",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gi.reposito... |
357093488 | import json
from mocap_bridge.utils.event import Event
from mocap_bridge.utils.color_terminal import ColorTerminal
class RigidBody(object):
def __init__(self, id=None, position=None, orientation=None, name="unnamed", obj=None):
self.id = id
self.position = position
self.orientation = orient... | null | python/mocap_bridge/interface/rigid_body.py | rigid_body.py | py | 2,680 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mocap_bridge.utils.event.Event",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
203826748 | import codecs, sys, re
import jieba
if __name__ == '__main__':
f = codecs.open('./data/train.txt', "a+", 'utf-8')
for line in open("./data/wiki.zh.jian.text"):
for i in re.sub('[a-zA-Z0-9]', '', line).split(' '):
if i != '':
data = list(jieba.cut(i, cut_all=False))
... | null | word_segmentation.py | word_segmentation.py | py | 445 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "codecs.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jieba.cut",
"line_number": 9,
"usage_type": "call"
}
] |
295866526 | from django.contrib import admin
from checks.models import Printer, Check
# Register your models here.
class CheckAdmin(admin.ModelAdmin):
list_display = ('id','printer_id', 'type', 'status')
list_filter = ('type', 'status', 'printer_id__point_id', 'printer_id__name')
class PrinterAdmin(admin.ModelAdmin):
list_dis... | null | smena/checks/admin.py | admin.py | py | 444 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 9,
"usage_type": "attribute"
}... |
419224185 | """
对指定路径文档进行加载处理
可在配置文件中对中英文分词方法进行选择配置
"""
import sys
sys.path.append('..')
from sklearn.model_selection import train_test_split
import config.get_config as _config
from common import tokenize
import tensorflow as tf
import numpy
import re
import jieba
def load_single_sentences(path, num_sentences, column):
"... | null | hlp/mt/common/preprocess.py | preprocess.py | py | 13,239 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "config.get_config.reverse",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "config.get... |
69180037 | """
#------------------------------------------------------------------------------
# Create ZV-IC Shaper
#
# This script will take a generalized input from an undamped second order system subject
# to nonzero initial conditions and solve the minimum-time ZV shaper using optimization
#
# Created: 6/20/17 - Daniel Newm... | null | Papers/Journal_Concurrent_2018/code/lqr_optimized_crane.py | lqr_optimized_crane.py | py | 15,174 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.simplefilter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "warnings.simplefilter",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "numpy.inf",... |
133972153 | import copy
import matplotlib as mpl
import matplotlib.pyplot as plt
import openmc
import os
class Optimize:
####################################################################
def __init__(self, num_groups, legendre):
self.G = num_groups
self.L = legendre
###################################################... | null | optimize.py | optimize.py | py | 11,214 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 113,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "openmc.mgxs.EnergyGroups",
... |
119613641 | # Ejercicio 2 (20 puntos)
# Resuelva la ecuación de advección lineal d_t u + c d_x u = 0.
# La condición inicial es una función gaussiana centrada en 0.0 y de sigma 0.1.
# La ecuación debe ser resuelta hasta un tiempo final T=0.5 y una velocidad c=-1.0.
# El programa debe hacer una gráfica (adveccion.png) con la condi... | null | ejercicio2.py | ejercicio2.py | py | 964 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number":... |
318623260 | import urllib
import datetime as dt
from bs4 import BeautifulSoup
from aylienapiclient import textapi
APP_ID = '8a322818'
APP_KEY = 'f53880d3b35631223a94f7243440e57a'
def get_url_info(url):
"""
Obtain url info using beautifulsoupp
:param url: (string)
:return: (dict) page title, page description or ... | null | app/api/utils.py | utils.py | py | 1,611 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.urlopen",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "datetime.... |
161943143 | # -*- coding: utf-8 -*-
"""Tests for downloader.py"""
from threedi_scenario_downloader import downloader
import configparser
import os
def test_set_headers():
config = configparser.ConfigParser()
config.read("threedi_scenario_downloader/tests/testdata/realconfig.ini")
downloader.set_headers(
confi... | null | threedi_scenario_downloader/tests/test_downloader_manual.py | test_downloader_manual.py | py | 5,584 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "threedi_scenario_downloader.downloader.set_headers",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "threedi_scenario_downloader.downloader",
"line_number": 11,
"... |
82817645 | from . import admin
from ..models import User
from ..models import Article
from .forms import LoginForm, RegistrationForm, PostForm
from .. import db
from config import is_exist_admin
from flask import render_template
from flask import redirect
from flask import url_for
from flask import flash
from flask.ext.login impo... | null | flask-tutorial-master/app/admin/views.py | views.py | py | 2,698 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "forms.PostForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.ext.login.current_user.is_authenticated",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.ext.login.current_user",
"line_number": 20,
"usage_type": "name"
... |
180188676 | from ply import lex
import ply.yacc as yacc
import matplotlib.pyplot as plt
import networkx as nx
tokens = (
'VAR',
'LPAREN',
'RPAREN',
'OPERATORS',
'TRUE',
'NOT',
'FALSE',
)
t_ignore = ' \t'
t_LPAREN = r'\('
t_RPAREN = r'\)'
t_TRUE = r'1'
t_FALSE = r'0'
t_NOT = r'\~'
t_VAR = r'[p,q... | null | src/driver2.py | driver2.py | py | 1,940 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ply.lex.lex",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ply.lex",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "ply.yacc.yacc",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "ply.yacc",
"line_number": 88,
... |
506141999 | import skvideo.io
import os
import argparse
import time
import cv2
import math
import numpy as np
def video2frame(video_name, save_path):
print("Reading {} and saving at {}".format(video_name, save_path))
cap = skvideo.io.vreader(video_name)
#cap = cv2.VideoCapture(video_name)
#cap.se... | null | track1/track/tools/Video2Frames.py | Video2Frames.py | py | 2,426 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "skvideo.io.io.vreader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "skvideo.io.io",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "skvideo.io",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "skvideo.io.io.FFm... |
235197693 | from django import forms
from .models import Product, Category, Brand
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = '__all__'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
categories = Category.objects.all()
categori... | null | products/forms.py | forms.py | py | 637 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Product",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Category.... |
606179938 | import pygame
import os
class Ghost(pygame.sprite.Sprite):
color = None
score = None
name = None
speed = None # Can be boosted when we add potion-like items that appear randomly
image = None
whichimage = 1
def __init__(self, color, score, name, speed):
pygame.sprite.Sprite.__init... | null | PacMan.py | PacMan.py | py | 1,348 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygame.sprite",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "py... |
221366190 | from django.db import models
import datetime
class Project(models.Model):
name = models.CharField(max_length=120)
start_date = models.DateField(auto_now_add=True, blank=True)
end_date = models.DateField(blank=True, null=True)
completed = models.BooleanField(default=False, blank=True)
def __uni... | null | projects/models.py | models.py | py | 1,288 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
439436969 | '''
This script parses text from the HASP telemetry website and takes the latest
file and checks to see if new information has been pushed to it. If new
information was put in the file, it prints it to the command line and saves
it to a single file. It runs in an infinite loop.
'''
import requests
import re
import ... | null | Software/Ground_Code/new_telemetry_updater/telem_parser.py | telem_parser.py | py | 3,493 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 60,
"usage_type": "call"
}
] |
96247675 | from flask import Blueprint, jsonify,render_template,request,redirect
from flask_jwt_extended import (JWTManager, jwt_required, create_access_token,get_jwt_identity)
from models.user import User,Images,Amount
from models.following import Following
from flask_wtf.csrf import CsrfProtect
from app import app
from app impo... | null | instagram_api/blueprints/users/views.py | views.py | py | 4,352 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.user.User.select",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "models.user.User",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.jsonif... |
601695264 | import asyncio
#协程的并发
async def do_some_work(x):
print('Waiting:',x)
await asyncio.sleep(x)
return 'Done after {} s.'.format(x)
#生成协程对象
coroutine1=do_some_work(1)
coroutine2=do_some_work(2)
coroutine3=do_some_work(4)
#将协程转换成task,并组成list
tasks=[
asyncio.ensure_future(coroutine1),
asyncio.ensure_fut... | null | coroutine2.py | coroutine2.py | py | 677 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "asyncio.sleep",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.ensu... |
34617864 | import argparse, pickle
import numpy as np
import os
import torch
from torch import nn, optim
# Use the util.load() function to load your dataset
from .models import *
import ray
from .policy_eval import PolicyEvaluator
ray.init()
dirname = os.path.dirname(os.path.abspath(__file__))
levels = [
'01 - Welcome to ... | null | homework_11/homework/play.py | play.py | py | 1,466 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ray.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_num... |
633132693 | import sys
import os
# from _pickle import dump
sys.path.insert(0, os.path.abspath('..'))
import numpy as np
import cv2
import matplotlib.pyplot as plt
from calibrate import Calibrarte
import matplotlib.image as mpimg
from frametracking import g_frame_tracking
class Threshold(Calibrarte):
def __init__(self):
... | null | threshold.py | threshold.py | py | 11,791 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.insert",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
425672077 | from graphviz import Digraph
import argparse, json, glob, os, fnmatch, re
DEBUG = False
class Module:
def __init__(self, module):
self.key = module['key']
self.pattern = re.compile("#include\s+[\"<]%s" % self.key)
self.label = module.get('label', self.key)
self.external = module.ge... | null | cradar.py | cradar.py | py | 4,754 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "graphviz.Digraph",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 1... |
409884161 | # -*- coding:utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('blog.views',
url(r'authors^', 'view_authors', name='view_avtors'),
url(r'^authors/(\d+)/$', 'view_writing_objects', name='view_writing_objects'), #(\d+)/$ - это переменная, которую мы хотим получить
url(r'^writing_ob... | null | blog/urls.py | urls.py | py | 492 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.patterns",
"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": "djan... |
313253309 | #!/usr/bin/env python
"""
Physics-based word cloud layout tool using Pyglet.
"""
import random
import math
from colorsys import hsv_to_rgb, rgb_to_hsv
import json
import numpy
import pyglet
from pyglet.gl import *
window = pyglet.window.Window()
words = [
('opengl', 11),
('pyglet', 10),
('event', 10)... | null | forcecloud.py | forcecloud.py | py | 17,096 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.window.Window",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyglet.window",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "colorsys.rgb_to_h... |
437242698 | #
# @lc app=leetcode.cn id=406 lang=python3
#
# [406] 根据身高重建队列
#
# https://leetcode-cn.com/problems/queue-reconstruction-by-height/description/
#
# algorithms
# Medium (61.48%)
# Likes: 223
# Dislikes: 0
# Total Accepted: 15.6K
# Total Submissions: 25.3K
# Testcase Example: '[[7,0],[4,4],[7,1],[5,0]... | null | Medium/406.根据身高重建队列.py | 406.根据身高重建队列.py | py | 2,379 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
380552079 | ################################################################################
# Interactive program to plot any development indicator from the
# worldbank development indicator database. The data is available here:
# https://www.kaggle.com/worldbank/world-development-indicators
# Problems with this script:
# 1) Ve... | null | plot any indicator.py | plot any indicator.py | py | 5,541 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"li... |
529220597 | import humanize
import redis
import os
import signal
import logging
import socket
from rq.registry import (StartedJobRegistry,
FinishedJobRegistry,
FailedJobRegistry,
DeferredJobRegistry,
ScheduledJobRegistry)
from rq.co... | null | rqmonitor/utils.py | utils.py | py | 15,295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "rq.registry... |
671226 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('blog.views',
url(r'^$', 'posts', name='blog'),
url(r'^post/(?:slug-(?P<post_slug>[\w\-]+)/)?$', 'get_post', name='get_post'),
... | null | blog/urls.py | urls.py | py | 686 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 7,
"usage_type": "call"
},
{
"api... |
274261121 | import tweepy
from json import dump, dumps
from utils import is_only_link, clean_words, gen_words_data, gen_hours_data, top_n_values, gen_rates, sumDics
CONSUMER_API_KEY = 'mCc3HnKcRCmcgBhuXOLaa8zYc'
CONSUMER_API_SECRET_KEY = 'NapiN4m1Y9YcmFzp3309oqgnojJXoqh1drhtH1I379MIZav33H'
ACCESS_TOKEN = '3482144423-132S1gPSgspgE... | null | main.py | main.py | py | 2,427 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tweepy.OAuthHandler",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tweepy.API",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "utils.is_only_link",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "utils.clean_words",... |
586249926 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
from accounts.views import AccountList
from accounts.urls import account_urls
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"... | null | crmeasy_django/crmapp/urls.py | urls.py | py | 972 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.conf.urls.patterns",
"line_number": 10,
"usage_type": "call"
},
{
"ap... |
449286720 | from matplotlib import pyplot as plt
movies = ["Annie Hall", "Ben-Hur", "Casablanca", "Gandhi", "West Side Story"]
num_oscars = [5, 11, 3, 8, 10]
#Valor padrão da barra 0.8
#Para centralizar adicionamos 0.1
xs = [i for i, _ in enumerate(movies)]
#Barras com x à esq., altura[num_oscars]
plt.bar(xs,num_oscars)
plt.y... | null | bar_mplt.py | bar_mplt.py | py | 542 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.ylabel",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matp... |
232839571 | # -*- coding: future_fstrings -*-
import logging
from .. import loader, utils
logger = logging.getLogger(__name__)
def register(cb):
cb(PythonMod())
# We dont modify locals VVVV ; this lets us keep the message available to the user-provided function
async def aexec(code, **kwargs):
# Note to self: please do... | null | friendly-telegram/modules/python.py | python.py | py | 2,210 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
}
] |
599952991 | from abc import ABC, abstractmethod
from enum import Enum
import numpy as np
from pysc2.lib import static_data
from pysc2.lib import actions as pysc2_actions
from pysc2.lib.features import FeatureUnit, PlayerRelative
class ParamType(Enum):
SPACIAL = 1
SELECT_UNIT = 2
NO_PARAMS = 3
class EnvironmentInter... | null | saves/SyncMarines/code/env_interface.py | env_interface.py | py | 14,285 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.stack",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.stack",
"line_number": 37,
... |
160651195 | from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
from PyQt5.QtCore import *
import sys, sqlite3
dbName = 'student.db'
class MyDlg:
def __init__(self):
self.dlg = loadUi('work.ui')
self.dlg.inputButton.clicked.connect(self.inputBtnClick)
self.dlg.showButton.clicked.connect(self.sho... | null | Python/pythonTest_class/BackUp/4일차/전기춘/work.py | work.py | py | 2,326 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
... |
616842664 | import numpy as np
import matplotlib.pyplot as plt
Bb = 0.2497
Bd = 5.16
Ad = 0.3105
Ah = 64.3
def V_obs(R,Mb,Md,Mh):
return Mb**0.5*R/(R**2 + Bb**2)**(3/4) + Md**0.5*R/(R**2 + (Bd+Ad)**2)**(3/4) + Mh**0.5/(R**2 + Ah**2)**0.25
data = np.genfromtxt("RadialVelocities.dat", delimiter= " ", skip_header = 1)
R = data[... | null | Plots.py | Plots.py | py | 788 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
506280564 | """Test suite for ansible-lint."""
import tempfile
import shutil
import os
from ansiblelint import Runner
class RunFromText(object):
"""Use Runner on temp files created from unittest text snippets."""
def __init__(self, collection):
"""Initialize a RunFromText instance with rules collection."""
... | null | test/__init__.py | __init__.py | py | 1,562 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ansiblelint.Runner",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
173740183 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : plot.py
@Time : 2018/12/08 18:31:57
@Author : 靳卫华
@Version : 1.0
@Contact : wh.jin@hotmail.com
@Desc : None
'''
# here put the import lib
import plotly
plotly.tools.set_credentials_file(username='wh.jin', api_key='DADs4nY8rboe9LuL6Iuz')... | null | plot_features.py | plot_features.py | py | 1,064 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "plotly.tools.set_credentials_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "plotly.tools",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pandas.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
486988753 | # CT60A0201 Ohjelmoinnin perusteet 2016 ohjelmien otsikkotiedot.
# Tekijä: Annika Vieraankivi
# Opiskelijanumero: 0506688
# Päivämäärä: 19.12.2016
# Yhteistyö ja 1lähteet, nimi ja yhteistyön muoto: -
# HUOM! KAIKKI KURSSIN TEHTÄVÄT OVAT HENKILÖKOHTAISIA!
#################################################################... | null | ht.py | ht.py | py | 7,514 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "svgwrite.Drawing",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "svgwrite.Drawing",
"line_number": 164,
"usage_type": "call"
}
] |
6176480 | import torch as th
import torch.nn as nn
import torch.nn.functional as F
class FactoredCentralVCritic(nn.Module):
def __init__(self, scheme, args):
super(FactoredCentralVCritic, self).__init__()
self.args = args
self.n_actions = args.n_actions
self.n_agents = args.n_agents
... | null | src/modules/critics/factored_centralV.py | factored_centralV.py | py | 2,587 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
248761909 | import sys
from OldLogic.OldLogic import OldLogic
from enum import Enum
from enum import unique
class MACDHigh(OldLogic):
# 新高次数
_achieveTimes = 3;
__dataFragments = []
def __init__(self):
self._logicID = "0001"
self._logicName = "MACD在0轴上出现N次新高"
self._logicDesc = "DIF在0轴上出... | null | OldLogic/MACDHigh.py | MACDHigh.py | py | 5,854 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "OldLogic.OldLogic.OldLogic",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sys.maxsize",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 148,
"usage_type": "name"
},
{
"api_name": "enum.unique",
... |
140148975 | from django.shortcuts import render, redirect, get_object_or_404
import datetime
from .models import *
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.contrib.auth.decorators import login_required
from .forms import UploadPostForm
from django.http import HttpResponse
from django.con... | null | app/views.py | views.py | py | 7,725 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "django.core.paginator.Paginator",
"line_number": 59,
"usage_type": "call"
},
{
"api_... |
234597329 | from jinja2 import Environment, FileSystemLoader
from config import config
import yaml
def create_dockerfile(env_file_path, **kwargs):
dockerfiles_dir = config['docker']['dockerfiles_dir']
dockerfile_name = config['docker']['dockerfile_name']
bootstrap_server = config['kafka']['servers']
producer_topi... | null | drboson-agent/src/templates.py | templates.py | py | 1,113 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_numb... |
388188575 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import requests
class GitLab:
"""GitLab Api handler class
Attributes:
----------
url : str
api base url
token : str
gitbucket user token
req_header : str
api request header
"""
def __init__(... | null | ci/gitlab.py | gitlab.py | py | 1,858 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 83,
"usage_type": "call"
}
] |
22580409 | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
from __future__ import division
import collections
import itertools
import json
import numbers
import numpy
import toyplot.color.css
import uuid... | null | toyplot/svg.py | svg.py | py | 39,122 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "toyplot.color.css._combine_styles",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "toyplot.color.css",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "toyplot.color.css._combine_styles",
"line_number": 28,
"usage_type": "call"
},
{
... |
26854672 | import utils
import numpy as np
class BaseParticleFilter(object):
def __init__(self, f, g, Q, R, x0=0, x_ref=None):
""" """
self.f = f
self.g = g # current global model
self.Q = Q
self.R = R
self.x0 = x0
self.x_ref = x_ref
self.resampling = 'multi'
... | null | 2_4_SMC_part_2/githubcodes/baseParticleFilter.py | baseParticleFilter.py | py | 1,529 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.particleGeneologyAll",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.particleGeneology",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.... |
579078329 | '''
Created on 20150605
@author: Administrator
'''
import urllib.request
import urllib.parse
import geohash
import threading
import gdal
def getmetadata(content, whatyouwant):
youwantinfo = content[content.find(whatyouwant) + len(whatyouwant) + 5 : ]
youwantinfo = youwantinfo[0 : youwantinfo.find("<td class=\"... | null | test_getsatelliteinfofromhttp.py | test_getsatelliteinfofromhttp.py | py | 5,258 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib.request.parse.urlencode",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 41,
"usage_type": "name"
},
{
"api_name"... |
92779925 |
from dataclasses import dataclass, field, fields
import dataclasses
from typing import List, Any
from assets.connection_map import left_hand, right_hand, body, face, main_data_class
# numpy
import numpy as np
# load dash components
import numpy as np
import dash
import dash_bootstrap_components as dbc
import dash_c... | null | freemocap_visualization.py | freemocap_visualization.py | py | 7,973 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "assets.connection_map.left_hand",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "assets.connection_map.right_hand",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "assets.connection_map.body",
"line_number": 38,
"usage_type": "name"
}... |
438703659 | import os # Path setting and file-retrieval
import cv2 # OpenCV
import time # Timing Execution
import numpy as np # See above
import CONFIG as cfg # Debug flags and constants
from shutil import rmtree # Directory removal
import secrets # ... | null | CUDADecrypt.py | CUDADecrypt.py | py | 4,612 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "CONFIG.PATH",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
... |
102848635 | '''Parse JVM class file, according JAVA SE 8 spec
'''
import os
import logging
from lib import read_bytes
from lib import constant_pool
from lib import attributes
from lib import run_time_data
classpath = './'
java_home = ''
java_library_path = ''
class ClassStruct(object):
'''Store compiled class structures suc... | null | lib/class_loader.py | class_loader.py | py | 12,767 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lib.constant_pool.ConstantClass",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "lib.constant_pool",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "lib.constant_pool.ConstantUtf8",
"line_number": 43,
"usage_type": "attribute"
},... |
99172023 | import logging
import time
from multiprocessing import Manager
from multiprocessing import Process
from threading import Lock
from threading import Thread
import requests
from flask import Flask
from flask import redirect
from flask import request
from werkzeug.wrappers import Response
import arc852.cli_args as cli
... | null | arc852/process_image_server.py | process_image_server.py | py | 7,225 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "arc852.cli_args.template_file",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "arc852.cli_args",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "... |
35814366 | import csv
import numpy as np
from matplotlib import pyplot
def readData(fileName):
# 读数据.
rawData = open(fileName, 'rt')
reader = csv.reader(rawData, delimiter=',', quoting=csv.QUOTE_NONE)
# skip the header
x = list(reader)[1:]
return np.array(x).astype('float')
# 最先调用时befIsTrue == 1, 即初始时第... | null | 机器学习_Machine Learning_NJUCS_2020spring_homework/1/Problem_2.py | Problem_2.py | py | 3,484 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_NONE",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_nu... |
349486171 | import threading
import server
import time
from vst_reader import VstReader
from bpm_detector import BpmDetector
from suggestion_context import SuggestionContext
from pentatonic import get_note_name
import operator
from collections import deque
import pentatonic
from chord_suggestion import get_random_chord
import rand... | null | Backend/startup.py | startup.py | py | 6,689 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pentatonic.ind_to_note",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "penta... |
94138901 | from utils.log import logger
from utils.utils import load_from_csv, load_csv_from_zip
test_file = 'data/back1.csv'
def get_bounds():
logger.debug('Getting bounds')
cart_x_y, cart_z = load_from_csv(csv_name=test_file)
#cart_x_y, cart_z = load_csv_from_zip(zipname='data/erie_lld.csv.zip', filename='erie_ll... | null | config.py | config.py | py | 629 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.log.logger.debug",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.log.logger",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.utils.load_from_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "utils.... |
47197361 | import yfinance as yf
import random
def percent_change(original, final):
try:
original = float(original)
final = float(final)
change = final - original
change = change / original * 100
change = float('{:.2f}'.format(change))
except:
change = None
retur... | null | cyberapp/programs/stocks.py | stocks.py | py | 1,563 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "yfinance.Ticker",
"line_number": 30,
"usage_type": "call"
}
] |
427580239 | from flask import (
render_template,
request,
redirect,
url_for,
Blueprint,
)
from routes import *
from models.board import Board
main = Blueprint('board', __name__)
@main.route('/admin')
def index():
if is_admin():
bd = Board.find_all(deleted=False)
return render_template('... | null | bbs-master/routes/board.py | board.py | py | 879 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "models.board.Board.find_all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "models.board.Board",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.