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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
341655684 | import math
import os
import random
import pygame
from pygame.locals import *
# CONSTANTS
TOTALS = 137 # 8 * 17
ROW = 8
COL = 17
TILE_ROW = 50
TILE_COL = 64
class Tile:
def __init__(self, name, img):
self.name = name
self.img = img
class Operation:
def __init__(self, op_type, tile, list_po... | null | board.py | board.py | py | 13,866 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_nu... |
87948513 | from pyspark import SparkConf, SparkContext
from pyspark.mllib.clustering import KMeans
from settings import config
from common import parse_word2vec
def output_format(word_cluster):
(word, cluster) = word_cluster
return str.format('%s %s' % (str(word), cluster))
def main():
conf = SparkConf().setAppNam... | null | a2/k_means.py | k_means.py | py | 761 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "common.parse_word2vec",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "sett... |
406690917 | import numpy as np
import matplotlib.pyplot as plt
def softmax(x, sum_axis=0):
'''
softmax 实现
:param x: list or np.array (can be n*m table)
:return: np.array of softmax
'''
p = np.exp(x)
total = np.sum(p, axis=sum_axis)
return np.array(p/total)
def task1():
# 简单的测试
score = [3.0... | null | homework/udacity_deeplearning/1_softmax.py | 1_softmax.py | py | 2,398 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.exp",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 21,... |
291394109 | """product_catalog URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cla... | null | product_catalog/urls.py | urls.py | py | 984 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.con... |
279059305 | import mxnet as mx
from mxnet import gluon
from mxnet.gluon import HybridBlock
from resuneta.nn.Units.resnet_units import *
from resuneta.nn.Units.resnet_atrous_units import *
from resuneta.nn.pooling.psp_pooling import *
from resuneta.nn.layers.scale import *
from resuneta.nn.layers.combine import *
from resuneta... | null | models/resunet_d6_encoder.py | resunet_d6_encoder.py | py | 4,237 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mxnet.gluon.HybridBlock",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "mxnet.gluon.HybridBlock.__init__",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mxnet.gluon.HybridBlock",
"line_number": 21,
"usage_type": "name"
}
] |
52580706 | import argparse
from pathlib import Path
parser = argparse.ArgumentParser(description='Train a Rubik\'s cube solver with Double Deep Q-networking')
model = parser.add_argument_group('Model')
model.add_argument('--model', '-M', required=False, type=Path, default=None, metavar="<MODEL_PATH>", help="The path to a model... | null | user_input.py | user_input.py | py | 858 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "name"
}
] |
245955320 | import pygame
class Snake:
def __init__(self,length, color, width=15, height=15):
self.width = width
self.height = height
self.margin = 3
self.speed = self.width + self.margin
self.x_speed = self.speed
self.y_speed = 0
self.length = length
self.color = color
self.snake_body = []
self.snake = p... | null | snake.py | snake.py | py | 1,387 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.sprite.Group",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surf... |
432131264 | #! /usr/bin/env python
#coding=utf-8
from uliweb import settings
from PIL import Image,ImageDraw,ImageFont,ImageFilter
import logging
import random
import string
import os
logger = logging.getLogger('generate_verification_code')
def gene_code(username, size = settings.VERIFICATIONCODE.SIZE,
number = se... | null | shapps/auth/verification_code/__init__.py | __init__.py | py | 2,977 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "uliweb.settings.VERIFICATIONCODE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "uliweb.settings",
"line_number": 13,
"usage_type": "name"
},
{
"api_name"... |
155752905 |
from flask import Blueprint, request, Response
import logging, json
from flasgger import swag_from
from flask_restful import Resource, Api
from server.routes.prometheus import track_requests
from userapp.server.domain.doaf_vaccine_order_optimizer import VaccineOrderOptimizer
from userapp import reefer_consumer, invent... | null | server/api/optimize.py | optimize.py | py | 2,084 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask_restful.Api",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_restful.Resource",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "userapp.serv... |
232753904 | # coding: utf-8
import json, glob,codecs, re
import xml.etree.ElementTree as ElementTree
#~ source = open("bokaryov/out.xml","rt")
source = open("dyer/out.xml","rt")
root = ElementTree.parse(source)
articles = []
index = {}
c=0
for ar in root.findall("ar"):
xml = ElementTree.tostring(ar, enc... | null | xdxf2json.py | xdxf2json.py | py | 1,245 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": ... |
191780113 | from functools import reduce
import random
from string import ascii_letters, digits
import os
import teca.filesystem as tecafs
from six import next as _next
import logging
def _d(n, k):
return reduce(lambda x, y: x*y, range(n-k+1, n+1), 1)
def generateToken(list_of_tokens=None, lenght=7, alphabet=ascii_letters+di... | null | teca/generation.py | generation.py | py | 2,138 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "string.ascii_letters",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "string.digits",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "random.sample",
... |
647013990 | # =============================================================================
# Get the ToA data from the .csv file and plot it
# Defined as function for the "All_in_One.py" script
# =============================================================================
import numpy as np
import matplotlib.pyplot as plt
import... | null | Functional/modules/ToA_func.py | ToA_func.py | py | 2,657 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.insert",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line... |
465702518 | import pytest, json
from mobile import app
from models.main import User
from unittest.mock import patch
from flask_jwt_extended import (create_access_token)
from models.appendix import Memory
import sys
sys.path.append('..')
from config import Config
import sqlalchemy
from sqlalchemy.orm import sessionmaker
engine =... | null | tests/conftest.py | conftest.py | py | 2,412 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "config.Config.PO... |
109777272 | import matplotlib.pyplot as plt
import numpy as np
import random as rnd
def ca_1d(k,n,l, t, rule, cell_i):
cell= cell_i
data= [cell]
for i in range(t):
cell_next= [0 for i in range(l)]
for j in range(l):
#neighboringstate= cell[(j-1+l)%l]*4+cell[j]*2+cell[(j+1)%l]
ne... | null | 615-621/temp3.py | temp3.py | py | 3,419 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.log2",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 44,... |
501535195 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth import get_user_model
from django.contrib.sites.models import get_current_site
from django.contrib.admin import SimpleListFilter
from django.core.files.images import get_image_dimens... | null | opps/images/admin.py | admin.py | py | 4,031 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.SimpleListFilter",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 21,
"usa... |
221439220 | import os
import os.path
import logging
import yaml
import shutil
from pprint import pformat
from jinja2 import Environment, FileSystemLoader
from markdown import markdown
# set up logging.
logging.basicConfig()
log = logging.getLogger(__name__)
def normalize_data_url(data_url):
return data_url.replace('/', '_')[... | null | unyielding/core.py | core.py | py | 3,964 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
54951269 |
from functools import reduce
l = map(lambda x: x+2, (1, 2, 3))
print(l)
f = filter(lambda x: x%2==1, (2, 3, 4, 5))
print(f)
a = reduce(lambda x, y: x+y, [1, 2, 3, 4])
# (((1+2)+3)+4) | null | note/python/map filter reduce/demo.py | demo.py | py | 201 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 11,
"usage_type": "call"
}
] |
422936238 | import logging
from behave import when, given
logger = logging.getLogger('navigation')
@given('the user waits {seconds:d} seconds for the "{element_name}" to be visible')
@when('the user waits {seconds:d} seconds for the "{element_name}" to be visible')
def when_wait_for_element(context, seconds, element_name):
... | null | veripy/steps/navigation/actions/wait_for_element.py | wait_for_element.py | py | 605 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "behave.given",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "behave.when",
"line_number": 8,
"usage_type": "call"
}
] |
346163914 | from itertools import zip_longest
def grouper(n, iterable, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args)
n = 80
with open('11-12-1p.txt') as f:
for i, g in ... | null | NNData/New folder/splitFile.py | splitFile.py | py | 465 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.zip_longest",
"line_number": 7,
"usage_type": "call"
}
] |
252098148 | import sys
sys.path.append('..')
import threading
import time
from multiprocessing import Queue
import numpy as np
from caffe2.python import workspace
from loadgen.dlrm_datagen import DLRMDataGenerator
from models.dlrm_queue import DLRMWrapper
from loadgen.packet import ServiceResponse
# import logging
# logging.ba... | null | loadgen/Infer_engine.py | Infer_engine.py | py | 5,657 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
107177108 | from textwrap import dedent
from django.views.generic.edit import FormView
from django.views.generic import TemplateView
from django.shortcuts import render
from django.urls import reverse_lazy
from django.contrib import messages
from .forms import MealRequestForm, GroceryRequestForm
from .models import MealRequest, G... | null | website/recipients/views.py | views.py | py | 2,802 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.FormView",
"line_number": 20,
"usage_type":... |
222023959 | # This script is for detecting ssl schema
# and every potential vulnerability related to it
import sys
import validators
import socket
import requests
R = '\033[31m' # red
G = '\033[32m' # green
C = '\033[36m' # cyan
W = '\033[0m' # white
Y = '\033[33m' # yellow
def good_netloc(netloc):
tr... | null | site.py | site.py | py | 8,060 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "socket.gethostbyname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "socket.inet_pton",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "socket.inet... |
426352483 | import PySimpleGUI as sg
import tkinter as tk
sg.theme('DarkAmber')
layout = [[sg.Text('hi')],
[[sg.Text('Another row')], sg.InputText()],
[sg.Button('ok'), sg.Button('cancel')] ]
window = sg.Window('hi', layout)
while True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'cancel':
... | null | attempt_UI.py | attempt_UI.py | py | 361 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.Text",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PySimpleGUI.InputTex... |
33553855 | import numpy as np
import sys
from scipy.io import FortranFile
import argparse
parser = argparse.ArgumentParser(description='')
parser.add_argument('--input_filename', type=str, required=True)
parser.add_argument('--output_filename', type=str, required=True)
args = parser.parse_args()
print('Converting ASCII file to ... | null | python_tools/ascii_to_unformatted.py | ascii_to_unformatted.py | py | 662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scipy.io.FortranFile",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sh... |
231148614 | import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
# read in a set of calibr8n imgs
imgs = glob.glob('camera_cal/calibration*.jpg')
#mpimg.imsave('test.jpg',img)
objpt = []
imgpt = []
xdim = 9
ydim = 6
# prep onj pts, e.g. (0,0,0), (1,0,0), ...
objp = np.zeros... | null | save4sub/camcal.py | camcal.py | py | 1,189 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "glob.glob",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.mgrid",
"line_numbe... |
161633329 | # -*- coding:UTF-8 -*-
import os
import time
import unittest
import retrying
from selenium.common.exceptions import TimeoutException
from base.basetest import BaseTestCase
from util import browser, testcaseinfo, report, noteLog, formatconvert
# from page import xxx
# retry method
def retry_if_timeout_exception(exc... | null | testcaseunit/login_moudel/oms106_login_by_phone.py | oms106_login_by_phone.py | py | 4,217 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "selenium.common.exceptions.TimeoutException",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "base.basetest.BaseTestCase",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "util.formatconvert.FormatConvert",
"line_number": 36,
"usage_t... |
390486499 | import multiprocessing as mp
import threading as td
def job1(a,d):
print("aaa")
def job2(a,b):
for i in range(9999999):
i = i + 0
print(i)
if __name__ == '__main__':
pool = mp.Pool()
p2 = pool.map(job2, args=(1,2))
p2.start()
p2.join()
p1 = pool.map(job1, args=(1,2))
... | null | test.py | test.py | py | 347 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 13,
"usage_type": "call"
}
] |
347002941 |
import asyncio
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import discord
from discord.ext import commands
import os
# imported from redbot utils
from .utils.dataIO import dataIO
# imported from cdt installations
from... | null | cdtscreenshot/cdtscreenshot.py | cdtscreenshot.py | py | 4,751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cdtdiagnostics.DIAGNOSTICS",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO.load_json",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.dataIO.dataIO",
"line_number": 31,
"usage_type": "name"
},
{
"api_... |
371456799 | import time
import random
import functools
class Solution:
# @param {string} num1
# @param {string} num2
# @return {string}
############################################################
## Thinking 1 : Using Python big number system automatically
################################################... | null | 043-Multiply-Strings_20150713.py | 043-Multiply-Strings_20150713.py | py | 3,559 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "functools.reduce",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "random.randint",
"lin... |
362922814 | from django.http import HttpResponse
from django.conf.urls import url, include
from rest_framework import routers, serializers, viewsets
from rest_framework.decorators import api_view
from rest_framework.response import Response
from io import BytesIO
from rest_framework.parsers import JSONParser
import json
import psy... | null | polosysBooks/masters/items.py | items.py | py | 6,255 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "io.BytesIO",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "rest_framework.parsers.JSONP... |
351885278 | """
This module manages persisting data from a message into the RDS Resource.
"""
# the postgresql connection module
import os
from psycopg2 import connect
from psycopg2 import OperationalError, DataError, IntegrityError
# project specific configuration parameters.
from .config import CONFIG
# allows for logging in... | null | src/rds.py | rds.py | py | 2,228 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getenv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.ERROR",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "config.CONFIG",
"l... |
355878654 | # -*-- coding: utf-8 -*--
from django.shortcuts import render
from django.conf import settings
from blog.models import *
from django.core.paginator import Paginator, InvalidPage, EmptyPage, PageNotAnInteger
import logging
logger = logging.getLogger('blog.views')
def global_setting(request):
return{'SITE_NAME':... | null | blog/views.py | views.py | py | 1,181 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.SITE_NAME",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 13,
"usage_type": "name"
},
{
"api_na... |
523420919 | import cv2
import numpy as np
frame = cv2.imread('/home/pi/DeepPiCar/driver/data/road1_240x320.png')
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_blue = np.array([60, 40, 40])
upper_blue = np.array([150, 255, 255])
mask = cv2.inRange(hsv, lower_blue, upper_blue)
edges = cv2.Canny(mask, 200, 400)
def detect_ed... | null | lineFind.py | lineFind.py | py | 1,099 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_n... |
223019832 | import time
import threading
from synapse.compat import queue
import synapse.common as s_common
import synapse.threads as s_threads
import synapse.eventbus as s_eventbus
class AsyncError(Exception):pass
class JobTimedOut(AsyncError):pass
class JobHasNoTask(AsyncError):pass
class BossShutDown(AsyncError):pass
class B... | null | synapse/async.py | async.py | py | 9,201 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "synapse.eventbus.EventBus",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "synapse.eventbus",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "synapse.eventbus.EventBus.__init__",
"line_number": 21,
"usage_type": "call"
},
{
... |
17587641 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "1.0.1"
__maintainer__ = "Jonas Lussi"
__email__ = "jlussi@ethz.ch"
"""Brief: Loads a csv File with input Vectors X and corresponding outputs y. Performs Ridge Regression with different
regularization parameters on 10 Fold-split of the data. Reports average... | null | Jonas/Task1/task1a/submission/main.py | main.py | py | 2,097 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sklearn.model_selection.KFo... |
142280862 | from django.urls import path
from . import views
app_name = 'store'
urlpatterns = [
path('', views.BooksListView.as_view(), name='main'),
path('manage/book/', views.ManageBooksList.as_view(), name='manage_list'),
path('manage/book/<int:pk>/', views.manage_update,
name='manage_upd... | null | store/urls.py | urls.py | py | 409 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
531824825 | """
Support for UPnP/IGD Sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.upnp/
"""
from datetime import datetime
import logging
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
... | null | homeassistant/components/sensor/upnp.py | upnp.py | py | 8,131 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "homeassistant.core.callback",
"line_number": 59,
"usage_type": "name"
},
{
"api_name": "homeassistant.components.upnp.const.DOMAIN",
"line_number": 77,
"usage_type": "name"
},
... |
254733083 | import json
from collections import OrderedDict
from ingest import ingest_xml_body
from housepy import config, log, strings, util, net
def parse(request):
log.info("beacon_spot.parse")
content = ingest_xml_body(request)
if content is None:
return content, "Could not parse"
# print(request.head... | null | ingest/beacon_spot.py | beacon_spot.py | py | 1,549 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "housepy.log.info",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "housepy.log",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ingest.ingest_xml_body",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.OrderedD... |
27765593 | import numpy as np
import pickle
import collections
import scipy.io
import time
import datetime
import copy
import albumentations as A
import cv2
from data_pre_processing import *
def augment_image(transform, image):
"""
"""
new_image = copy.deepcopy(image)
new_image = transform(image=new_im... | null | Scripts/data_augmentation.py | data_augmentation.py | py | 3,013 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "copy.deepcopy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number"... |
651420319 | import numpy as np
import pandas as pd
import os
import sys
import numpy
import matplotlib.pyplot as plt
import pandas
import math
import sklearn
import tensorflow as tf
#from tensorflow import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers impo... | null | MachLearnApp/testRNN3.py | testRNN3.py | py | 4,050 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line... |
324891819 | """
WSGI config for _1327 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
import sys
from django.core.wsgi import get_wsgi_application
sys.stderr = sys.stdout
p... | null | _1327/wsgi.py | wsgi.py | py | 566 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stderr",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
536410463 | # -*- coding: UTF-8 -*-
from __future__ import absolute_import, unicode_literals
import feedparser
from .news_finder import NewsFinder
from celery import shared_task, task
from .twitter_reader import TwitterReader
from celery.utils.log import get_task_logger
from requests import ConnectionError
logger = get_task_logg... | null | bori/tasks.py | tasks.py | py | 1,418 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "celery.task",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "twitter_reader.TwitterReader",
"line_number": 23,
"usage_type": "call"
},
{
"api_nam... |
82211135 | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import to... | null | fairseq/tasks/audio_finetuning.py | audio_finetuning.py | py | 34,603 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "fairseq.tasks.audio_pretraining.AudioPretrainingConfig",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 54,
"usage_type": "call"
},... |
355536594 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 8 10:57:27 2019
@author: zhangqiang
"""
import numpy as np
import pandas as pd
import datetime
import xgboost as xgb
from xgboost.sklearn import XGBRegressor
from sklearn.model_selection import GridSearchCV
X_train = pd.read_csv('../data/X_train_... | null | xgboost_allFeature.py | xgboost_allFeature.py | py | 3,999 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
474341989 |
import torch
import numpy as np
from scipy import integrate
from score_sampling import get_score_fn
from sbi.vi.first_second_order_helpers import jacobian_in_batch
from utils import *
def get_random_vec(shape, type="gaussian"):
if type.lower() == "gaussian":
return torch.randn(shape)
elif type.lower(... | null | pck1/sbi/score/score_log_prob.py | score_log_prob.py | py | 4,803 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.randn",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.randint",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.enable_grad",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_num... |
487293736 | from .vision import VisionDataset
# from ..utils.box_utils import center_form_to_corner_form
import torch
from PIL import Image
import os
import os.path
import logging
import numpy as np
import cv2
class CocoDetection(VisionDataset):
"""`MS Coco Detection <http://mscoco.org/dataset/#detections-challenge2016>`_ Data... | null | vision/datasets/coco_dataset.py | coco_dataset.py | py | 10,820 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "vision.VisionDataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pycocotools.coco.COCO",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
273703581 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.callbacks import TensorBoard, ReduceLROnPlateau
import ssl
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
from sklearn.metrics im... | null | baseline_model.py | baseline_model.py | py | 2,500 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ssl._create_default_https_context",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.applications.ResNet50",
"line_number": 19,
"u... |
420958497 | #!/usr/bin/env python
# coding=utf-8
import os
import shutil
import numpy as np
def MODULATION(delta, fileNumber):
for i in range(0, fileNumber):
displace = float(i * delta)
filename = 'modulation-' + str(displace)
conf = 'modulation-' + str(displace) + '.conf'
f = open(conf, 'w')
... | null | phonon/modulation.py | modulation.py | py | 3,278 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.system",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 29,... |
315788326 | import sys
import yfinance as yf
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import hashlib
from os import path
import json
import threading
import time
import math
import random
pd.set_option('display.max_columns', None)
pd.set_option('display.expand_frame_repr', False)
pd.set_option('... | null | mk1/sim02.py | sim02.py | py | 45,060 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.set_option",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv... |
568253634 | from io import BytesIO
import requests
from PIL import Image
import math
import random
def to_ll(ll):
if type(ll[0]) == float:
return f"{ll[0]},{ll[1]}"
else:
return ll
def from_ll(ll):
ll = ll.split(",")
return [float(ll[0]), float(ll[1])]
def full_adress(json):
return json["r... | null | geocoder.py | geocoder.py | py | 2,899 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "io.BytesIO",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number":... |
228461749 | import numpy as np
from scipy import optimize
def is_valid_density_band(P_min, P_max, dx):
return (
dx > 0.0
and all(np.sum(P_min, 1) * dx <= 1)
and all(np.sum(P_max, 1) * dx >= 1)
and np.all(P_min >= 0)
and np.all(P_min <= P_max)
)
def get_pos_root(func, x_max_guess... | null | Helper_Functions/robust_detection_helpers.py | robust_detection_helpers.py | py | 1,308 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.sum",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.all",
"line_number": 12,
"... |
206967786 | #{
# "data": [
# {"timestamp":1466640000,"value":0.27589941523037853},
# {"timestamp":1466640900,"value":0.4059699097648263},
# {...} ,
# {"timestamp":1466641800,"value":0.8376112426631153}
# ],
# "forecast_to":1458136800,
# "callback": "http://your.domain/yourcallback"
#}
import json
impo... | null | timeseries/Child Death Data/timeseries data/by region/num of neonatal deaths/clean.py | clean.py | py | 1,068 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.timestamp",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
651480199 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import cv2 as cv
import argparse
import quantizer as qnt
from helpers import psnr
def read_args():
parser = argparse.ArgumentParser(
description='Performs image color quantization.')
parser.add_argument('-i', dest='input', type=str,
... | null | main.py | main.py | py | 1,489 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "quantizer.simple",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "quantizer.uniform... |
396773478 | # Import future.
from __future__ import annotations
# Import typing.
from typing import Any
from typing import Tuple as MultiReturn
from typing import List, Union, Dict, Tuple
# Import dependencies.
import sys
import os
import re
import token
# Add development library to path.
if (os.path.basename(os.... | null | doc/main.py | main.py | py | 111,019 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.basename",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_n... |
231239972 | #!/usr/bin/env python
from __future__ import division
import argparse
import collections
import os.path as osp
import matplotlib
matplotlib.use('Agg') # NOQA
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
def learning_curve(json_file):
df = pd.read_json(json_file)
colors = sns... | null | scripts/learning_curve.py | learning_curve.py | py | 3,753 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_json",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "seaborn.husl_palette",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
202529912 | import numpy as np
import pandas as pd
import recorder as rd
import visualize as vz
import sounddevice as sd
import matplotlib.pyplot as plt
import os
import python_speech_features as psf
from play import listFile
defaultLen = 44100
particle = 100
def getWave_fixedLen (signal, pivot = 0, step=500, thresh... | null | standardize.py | standardize.py | py | 3,173 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "visualize.clamp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "visualize.clamp",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "visualize.clamp",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "visualize.clamp",
... |
527705719 | # -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
from scrapy import Request
from msic.proxy.proxy_pool import proxy_pool
from msic.proxy.proxy import Proxy
from scrapy_splash import SplashRequest
from spiders.free_proxy_list_lua_source import ... | null | ip_pool/spiders/ip_pool.py | ip_pool.py | py | 3,044 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "scrapy.xlib.pydispatch.dispatcher.connect",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "scrapy.xlib.pydispatch.dispatcher",
"line_number": 28,
"usage_type": "name"
... |
463653066 | """
Default URL patterns for the :py:mod:`ui` application are provided by the :py:mod:`.urls` module.
You can use the default mapping by adding the following to your global ``urlpatterns``:
.. code::
from django.urls import path, include
urlpatterns = [
# ...
path('', include('ui.urls')),
... | null | ui/urls.py | urls.py | py | 1,790 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.BASE_DIR",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "django.c... |
514348901 | import requests
import json
from django.http import JsonResponse
from zxy11.models import User
from django.core.exceptions import ValidationError, ObjectDoesNotExist
import random
def GetOpenid(code):
Response = requests.get(
"https://api.weixin.qq.com/sns/jscode2session?appid=wx90f7357f9e5fb100&secret=3... | null | 购物系统/zxy00/zxy11/Login.py | Login.py | py | 1,431 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "zxy11.models.User.ob... |
325516754 | from flask import Flask
from werkzeug.routing import BaseConverter
from werkzeug.wrappers import Response,Request
app = Flask(__name__)
# 视图传参:<>
# url的<>中传入的参数,必须传入视图函数中
# <>里默认是unicode字符串,兼容数值
# 数值之间不兼容
# /区分路径?&#= 锚点
# http://127.0.0.1:5000/abc/e1234/asdf
# Rule类:存储了所有的url规则
# Map类:存储了所有的Rule类对象
# MapAdapter类:负责匹配u... | null | learn_flask/day2/demo_args.py | demo_args.py | py | 752 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
}
] |
91563063 | import cv2
def minimumBoxFilter(n, path_to_image):
img = cv2.imread(path_to_image)
# Creates the shape of the kernel
size = (n, n)
shape = cv2.MORPH_RECT
kernel = cv2.getStructuringElement(shape, size)
# Applies the minimum filter with kernel NxN
imgResult = cv2.erode(img, kernel)
# Shows the result... | null | report4/6-5 maximum_filter.py | 6-5 maximum_filter.py | py | 1,456 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.MORPH_RECT",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.getStructuringElement",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.erode",
... |
10693341 | import mimetypes
from asyncio import ensure_future, get_event_loop
from os import mkdir, path
from signal import SIGINT, SIGTERM
from whalesong import Whalesong
from whalesong.driver_chromium import WhalesongDriver
from whalesong.managers.message import LocationMessage, MediaFrameMixin, MediaMixin, StickerMessage, Tex... | null | examples/getmessages-chromium.py | getmessages-chromium.py | py | 5,499 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "whalesong.Whalesong",
"line_... |
362456976 | # Name: platforms.py
# Purpose: Handles the platforms that the player will stand on. This module dictates all methods/attributes associated with the platforms
# Version: 2.1
# Date: 5 June 2020
# Author(s): Khoa Hoang, Matt Innaurato
# Dependencies: pygame, settings, and random modules
import pygame as pg
from settin... | null | src/platforms.py | platforms.py | py | 4,547 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "random.choice",
"lin... |
58072055 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-g", "--gpu", metavar="gpuid", type=int, default=-1,
help="GPU device ID (CPU if negative)")
parser.add_argument("-o", "--out", metavar="outfilename", type=str,
default="ram", help="prefix of output filenames... | null | train_ram.py | train_ram.py | py | 4,511 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sklearn.da... |
375217330 | import numpy as np
from scipy.ndimage import gaussian_filter
# Histogram related constants
DEFAULT_QUANTILES_CUTOFF_SUV = (0, 0.999)
DEFAULT_QUANTILES_CUTOFF_HU = (0, 0.999)
class Preprocessor():
def __init__(self,
smooth_sigma_mm={'PET': 2.0, 'CT': 0.0},
normalization_method=... | null | datautils/preprocessing.py | preprocessing.py | py | 4,285 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.loadtxt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage.gaussian_filter",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.float32"... |
102253229 | #
# Copyright (C) University College London, 2007-2012, all rights reserved.
#
# This file is part of HemeLB and is CONFIDENTIAL. You may not work
# with, install, use, duplicate, modify, redistribute or share this
# file, or any part thereof, other than as allowed by any agreement
# specifically made by you with Un... | null | Tools/steering/python/hemelb_steering/remote_hemelb.py | remote_hemelb.py | py | 3,380 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "paged_socket.PagedSocket",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "steered_parameter.initialise_in_instance",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 34,
"usage_type": "name"
},
{
"a... |
45509984 | # Copyright (C) 2020 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for extra views."""
import json
import ddt
import sqlalchemy as sa
from ggrc.models.relationship import Relationship
from integration.ggrc import TestCase
from integration.ggrc.models import facto... | null | test/integration/ggrc/views/test_views.py | test_views.py | py | 4,888 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "integration.ggrc.TestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "json.loads",
"lin... |
40404360 | # -*- coding: utf-8 -*-
from urllib.request import urlopen, Request
import urllib
import bs4
import lxml
location = '인천광역시 미추홀구 도화동'
enc_location = urllib.parse.quote(location + '+날씨')
url = 'https://search.naver.com/search.naver?ie=utf8&query='+ enc_location
req = Request(url)
page = urlopen(req)
html = page.read()... | null | Edith/Edith_GUI ( PyQt )/weather.py | weather.py | py | 1,290 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.parse.quote",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "urllib.request.Request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.requ... |
412401510 | import jaconv
import MeCab
tagger = MeCab.Tagger()
with open("A01F0055/A01F0055.trn", encoding="shift-jis") as trn:
for row in trn:
if row.split()[0].isalpha():
line = jaconv.kata2hira(''.join(row.split()[2:]))
print(tagger.parse(line))
| null | grad_resarch/perceptron/gettext.py | gettext.py | py | 275 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "MeCab.Tagger",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "jaconv.kata2hira",
"line_number": 9,
"usage_type": "call"
}
] |
127519750 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
import cv2
import numpy as np
from time import sleep
N_split = np.int(os.environ['N_SPLITS'])
cap = cv2.VideoCapture(2)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
img = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
row = np.arra... | null | color_detector.py | color_detector.py | py | 2,222 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.int",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_n... |
68465278 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# This file is part of the Tango SPEC device server
#
# Copyright (c) 2014, European Synchrotron Radiation Facility.
# Distributed under the GNU Lesser General Public License.
# See LICENSE.txt for more info.
#-----... | null | setup.py | setup.py | py | 1,064 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sphinx.setup_command.BuildDoc",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "sys.path.insert",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.d... |
642039916 |
# coding: utf-8
# In[3]:
import sys
import pandas as pd
import matplotlib.pyplot as plt
filename1 = sys.argv[1]
filename2 = sys.argv[2]
df1 = pd.read_table(filename1, sep=' ', header=None, index_col=1,
names=['lang', 'page', 'views', 'bytes'])
df2 = pd.read_table(filename2, sep=' ', header=None, index_col... | null | Assignment 2 - Plotting and Linear Regression/create_plots.py | create_plots.py | py | 1,035 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_table",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_table",
... |
647508491 | '''
Created on 25 Oct 2015
@author: jayre
'''
# Learn about API authentication here: https://plot.ly/python/getting-started
# Find your api_key here: https://plot.ly/settings/api
import plotly.plotly as py
import plotly.graph_objs as go
import numpy as np
from matplotlib import pyplot as plt
names = ['P... | null | Thesis/Python/Pyplot_Graphs/scale4.py | scale4.py | py | 1,768 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plotly.graph_objs.Bar",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "plotly.graph_objs",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "plotly.graph_objs.Layout",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "plot... |
254131750 | import time as Time
import numpy as np
import pandas as pd
from multiprocessing import Pool
from scipy.stats import kurtosis, skew, iqr, trim_mean
from scipy.signal import hilbert
from .base import Component
from .simple import DataGenerator
np.warnings.filterwarnings('ignore')
#
# abs_min == 0
# avg -> mean
# sum =... | null | smth/kaggle/earthquake_prediction/components/representer.py | representer.py | py | 8,779 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.warnings",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "base.Component",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "nump... |
305652093 | import requests
import json
class HttpRequest:
def __init__(self, endpoint, headers={"content-type": "application/json"}):
self.endpoint = endpoint
self.headers = headers
pass
def get(self, payload):
res = requests.get(self.endpoint, headers=self.headers, params=payload)
... | null | src/infrastructure/rest/http_request.py | http_request.py | py | 949 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
}
] |
221897773 | import numpy as np
from math import atan2
import os, sys
from scipy.spatial import distance
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform import Rotation as Kabsch
# home_path = "/home/boittier/Documents/AdjustReference-System/"
# # home_path = "/home/eric/Document... | null | ARS.py | ARS.py | py | 18,800 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.einsum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_num... |
448704397 | # Import libraries
import numpy as np
import keras
import keras.backend as K
from keras.models import Model
# Activation and Regularization
from keras.regularizers import l2
from keras.activations import softmax
# Keras layers
from keras.layers.convolutional import Conv2D, Conv2DTranspose
from keras.layers import Dense... | null | models/new_distances/elu_resnet_2d_distances.py | elu_resnet_2d_distances.py | py | 6,209 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.activations.softmax",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.backend.variable",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "keras.... |
21088481 | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
"Click>=7.0",
"Flask==1.1.2",
"authlib==0.15.3",... | null | setup.py | setup.py | py | 1,903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 62,
"usage_type": "call"
}
] |
494852567 | #!/usr/bin/python3
import sys, argparse
from http.server import HTTPServer, BaseHTTPRequestHandler
def parseArgs():
parser = argparse.ArgumentParser(description='For test API Client, webhook, ... ')
parser.add_argument('-p', '--port', help='Port to listen', dest='port', type=int, required=True)
parser.add... | null | HttpListener.py | HttpListener.py | py | 1,941 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "http.server.HTTPServer",
"line_number": 59,
"usage_type": "call"
},
{
"... |
239226954 | import arcade
import Const
from Button import MenuButton
from Food import Food
class Menu:
def __init__(self, main):
self.elements = []
self.text_menu = None
self.main = main
self.center = 0
self.high = 0
"""For instruction"""
self.is_instruction = False
... | null | out/production/Snake/Menu.py | Menu.py | py | 4,096 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Const.GAME_WIDTH",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "Const.GAME_HEIGHT",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "arcade.draw_text",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "arcade.... |
566218472 | import time
import threading
import PyQt6
from PyQt6 import QtCore
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QMessageBox
from pcr.hid_action import TxAction, RxAction
from pcr.hid_ctrl import Hid_manager
from pcr.constant import Command, State, State_Oper, DeviceConstant
import pcr.protocol as Protoco... | null | pcr/task.py | task.py | py | 9,608 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pcr.constant.State.READY",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "pcr.constant.State",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "pcr.constant.Command.NOP",
"line_number": 40,
"usage_type": "attribute"
},
{
"ap... |
369294348 | #! /usr/bin/env python3
import os, sys
namvi_mi_root = os.getcwd()+'/../..'
sys.path.append(namvi_mi_root)
from namv_mi.cost_model.cost_model import *
from namv_mi.utils import process_sim_results as sim
from namv_mi.utils.plot_templates import sub_dim
import glob
import pandas as pd
import numpy as np
import matplotli... | null | namv_mi/cost_analysis/deployment_scenarios_ytd.py | deployment_scenarios_ytd.py | py | 6,444 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "namv_mi.utils.plot_templates.sub... |
459442402 | import pandas as pd
import os.path
import matplotlib.pyplot as plt
# configure pyplot
plt.style.use('ggplot')
# directory with data files
DIR = 'data'
class Crypto(object):
'''class for accessing hitorical market data'''
def __init__(self, symbol):
'''object constructor'''
self.symbol = symb... | null | 180927_python_crypto/crypto.py | crypto.py | py | 1,884 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.style.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 6,
"usage_type": "name"
},
{
"api_name"... |
417178919 | import json
class Team:
def __init__(self, date, ranking, duration, level, members):
self.date = date
self.ranking = ranking
self.duration = duration
self.level = level
self.members = members
@classmethod
def fromAdaptor(cls, team: 'dict', model: 'dict') ... | null | GroupFinder/teamFinder.py | teamFinder.py | py | 3,299 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dump",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 80,
"usage_type": "call"
}
] |
365261083 | import pymysql
from contextlib import contextmanager
from sqlalchemy import event, create_engine
from sqlalchemy.exc import DisconnectionError
from sqlalchemy.orm import sessionmaker
from simple_profile.connectors.access import AccessDAO
class RawPyMySQL(object):
def __init__(self, access_dao):
self.acces... | null | simple_profile/connectors/dao.py | dao.py | py | 3,712 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.connect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pymysql.cursors",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "sqlalch... |
505283778 | # coding=utf-8
from PyQt5 import QtCore, QtGui, QtWidgets
import cv2
import os
import face
import sys
import facegui
import time as timer
import facenet
import align.detect_face
import numpy
import pickle
from scipy import misc
import tensorflow as tf
import numpy as np
from PIL import Image, ImageDraw, ImageFont
sys.... | null | src/main.py | main.py | py | 15,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
204689851 |
"""
Program for computing satellite crossovers from ascending and
descending orbits using linear or cubic interpolation.
The program takes as input two files separated into asc. and des. orbits
with a minimum number of variables: orbit number, lon ,lat, time and
height. The user can provide three extra variables ... | null | utils/xover_deprecated.py | xover_deprecated.py | py | 30,768 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.column_stack",
"line_number": 132,
"usage_type": "call"
},
{
"api_name": "n... |
642892560 | import tempfile
import os
from patsy.commands.checksum import Command, get_checksum
from patsy.core.load import Load
from argparse import Namespace
from tests import clear_database
def setUp(obj, gateway):
obj.gateway = gateway
# Arguments passed to checksum.Command
obj.checksum_command = Command()
o... | null | tests/test_checksum.py | test_checksum.py | py | 6,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "patsy.commands.checksum.Command",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "argparse.Namespace",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "patsy.core.load.Load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
357394847 | from django.shortcuts import render, redirect, reverse
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserLoginForm, UserRegisterForm, UserUpdateForm, ProfileUpdateForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth impor... | null | src/users/views.py | views.py | py | 1,750 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.UserRegisterForm",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "forms.UserRegisterForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
510109423 | import pandas as pd
import os
from sklearn.preprocessing import MinMaxScaler
import tensorflow as tf
print(tf.__version__) # 1.15.0
# Turn off TensorFlow warning messages in program output
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# load dataset
training_data_df = pd.read_csv("dataset/sales_data_training.csv", dtype=... | null | model.py | model.py | py | 4,619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.read... |
511452991 | def should_buy(cur_price, last_price_ns, cur_vol, avg_vol_nd, params={}):
"""
INPUT:
cur_price: float cur_price
last_price_ns: price for the past n seconds
cur_vol: float current volume
avg_vol_nd: average volume per second for the past n days
RETURN:
True: should buy. False: should not... | null | model/model_v0.py | model_v0.py | py | 8,244 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.nansum",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.nanmax",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.nanmin",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "numpy.nanmean",
"line_numb... |
299723095 | from flask import Flask, render_template, jsonify, request
from pymongo import MongoClient
app = Flask(__name__)
client = MongoClient('mongodb://test:test@localhost', 27017)
# client = MongoClient('localhost', 27017)
db = client.dbmaking
# HTML 화면 표시
@app.route('/')
def init():
return render_template('index.htm... | null | app.py | app.py | py | 4,338 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.render_temp... |
298787865 | import torch
import numpy as np
def iou_torch(bboxes_a, bboxes_b, bbox_type="x1y1x2y2", iou_type='IoU'):
if bbox_type is "x1y1x2y2":
i_tl = torch.max(bboxes_a[:, None, :2], bboxes_b[:, :2])#交集左上角坐标
i_br = torch.min(bboxes_a[:, None, 2:], bboxes_b[:, 2:])#交集右下角坐标
c_tl = torch.min(bboxes_a[:,... | null | yolov4_utils/iou_torch.py | iou_torch.py | py | 3,027 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.max",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.max",
"line_number": 9,
"usa... |
116609725 | import torch
class DataLoader(object):
def __init__(self, train, test, batch_size=128):
self.train_loader, self.test_loader = self.data_loader(train, test, batch_size)
def data_loader(self, train, test, batch_size=128, num_workers=4):
SEED = 1
# CUDA?
cuda = torch.cuda.is_ava... | null | utils/dataloader.py | dataloader.py | py | 971 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.manual_seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.cuda.... |
382299854 | import datetime
from django import template
from django.contrib.auth import get_user_model
UserModel = get_user_model()
register = template.Library()
today = datetime.date.today()
one_day_ago = datetime.datetime.now() - datetime.timedelta(days=1)
@register.simple_tag
def get_birthday_list():
""... | null | tango_user/templatetags/user_tags.py | user_tags.py | py | 1,093 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.template.Library",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 8,
"usage_type": "name"
},
{
"api_name"... |
287116591 | from django import forms
from .models import ContactUs, Feedback
class ContactForm(forms.ModelForm):
class Meta:
model = ContactUs
fields = ["first_name", "last_name", "email", "contact_no"]
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
fields = ['name', '... | null | blog/forms.py | forms.py | py | 565 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.ContactUs",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.M... |
326998069 | import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python.training import moving_averages
import numpy as np
from keras import layers
from keras.layers.merge import add,multiply
from keras.layers import Lambda, Input, Conv2D, Conv2DTranspose, MaxPooling2D, UpSampling2D, Cropping2D, cor... | null | TensorFlow_utils.py | TensorFlow_utils.py | py | 16,482 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.variable_scope",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_variable",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_nam... |
606894102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Builds and pickles a data structure to use for decoding verses with a specified
vocabulary. Any vocab words not in the pronouncing dictionary are ignored.
"""
from __future__ import print_function
from os import path
from vocab import VerseVocab
def main(in_voca... | null | verse-vocab/make_verse_vocab.py | make_verse_vocab.py | py | 1,495 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "vocab.VerseVocab",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "vocab.build",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "vocab.save",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
... |
580468512 | __author__ = 'vigor'
import pygame
import random
import math
from constants import *
from characters import *
GRAD = math.pi / 180 # 2 * pi / 360 # math module needs Radiant instead of Grad
class bullet:
""" a big projectile fired by the tank's main cannon"""
side = 15 # long side of bullet rectangle
ve... | null | projectiles.py | projectiles.py | py | 2,506 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.pi",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.rota... |
194618048 | # -*- coding: utf-8 -*-
import torch.nn as nn
import os
import pandas as pd
from PIL import Image
from torch.utils.data import Dataset
class clsLogging():
@staticmethod
def writeline(filename, line):
with open(filename, 'a+') as hFile:
hFile.write(line + '\n')
hFile.close()
@... | null | facenet_utils.py | facenet_utils.py | py | 3,536 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.nn.PairwiseDista... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.