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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
628898309 | __author__ = "Konstantin Klaus"
from game.game import Game
from game.loading_screen import LoadingScreen
from game.menu import Menu
import logging
from controller import buzzcontroller
import time
def dumb_task(seconds):
time.sleep(seconds)
print("finished waiting")
def main():
# logger
logger = l... | null | main.py | main.py | py | 994 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.sleep",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler... |
249202647 | from src import utils, svutils
import sys
import soundfile as sf
import pyworld as pw
WAVpath = sys.argv[1]
inGrid = open(sys.argv[2], 'r')
outVSQX = open(sys.argv[3], 'w')
mode = sys.argv[3]
if mode == "-sv":
x, fs = sf.read(WAVpath)
f0, t = pw.dio(x, fs, frame_period = utils.ms_per_dot)
svutils.write_head(outVSQ... | null | autoSVtalker.py | autoSVtalker.py | py | 748 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": ... |
181230169 | #!/usr/bin/python3
"""script that starts a Flask web application """
from flask import Flask
from flask import render_template
from models import storage
from models import State
app = Flask(__name__)
app.url_map.strict_slashes = False
@app.route('/states_list')
def states():
dict_states = {}
states_dic = st... | null | web_flask/7-states_list.py | 7-states_list.py | py | 646 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.storage.all",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.State",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "models.storage",
"... |
549917279 | # -*- coding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
STOP_RENDERING = runtime.STOP_RENDERING
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1528569756.767912
_enable_loop = True
_template_filename = '/home/hodard/dev/indico/src/indico/leg... | null | indico/data/tmp/mako_modules/2.1.2-dev/RoomBookingAdmin.tpl.py | RoomBookingAdmin.tpl.py | py | 6,222 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mako.runtime.UNDEFINED",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "mako.runtime",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "mako.runtime.STOP_RENDERING",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name":... |
22193091 | import numpy as np
import pandas as pd
import time
from evaluate import evaluation
from cross_validation import *
def sigmoid(x):
return 1/(1+np.exp(-x))
def to_lable(x):
if(x>=0.5):
return 1
else:
return 0
def LR_train(data, label, alpha, valid_data, gt, mode='SGD'):
# data第一列全1,增广向量
eva = np.zeros((1000,4... | null | linear_model/LR_softmax.py | LR_softmax.py | py | 3,345 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.exp",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 22,... |
13156026 | # TODO:
# Rotation algorithm......... (timestamp 4:49)
import pygame, sys, math
from pygame.locals import *
pygame.init()
# Rotation
def rotate2d(pos,rad):
x,y = pos
s = math.sin(rad)
c = math.cos(rad)
return x*c - y*s, y*c + x*s
# Camera
class Cam:
def __init__(self, pos=(0,0,0),rot=(0,0)):
self.pos... | null | 3D.py | 3D.py | py | 2,659 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.MOUSEMOTION",
"line_number": ... |
434884256 | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.1.1'
install_requires = [
'Flask>=0.6',
]
setup(name='briefs-caster',
version=ve... | null | setup.py | setup.py | py | 1,191 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
235587833 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 28 14:43:17 2018
@author: xsxsz
"""
import numpy as np
import matplotlib.pyplot as plt
import math
u=0;
sig=0.05
t=10000
a=np.zeros(1000)
for i in range(t):
a+=np.random.uniform(-5,5,1000)
a=(a-u)/(sig/math.sqrt(t))
plt.figure(figsize=(5,6))
p... | null | others/Central_Limit_Theorem.py | Central_Limit_Theorem.py | py | 447 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "math.sqrt",
"l... |
380924185 | import sys
from pathlib import Path
import re
def traverse(w):
p = Path('.')
for f in list(p.glob('**/*.txt')):
replace(f,w)
def replace(file_path, word):
regexp = re.compile(word, re.IGNORECASE)
with file_path.open() as f: input_str = f.readline()
print(file_path)
print(input_s... | null | files/tutorial05.py | tutorial05.py | py | 472 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
532814465 | # 諸々のモジュールのインポート
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
from matplotlib._png import read_png
from matplotlib.cbook import get_sample_data
from pylab import *
... | null | practice.py | practice.py | py | 2,502 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "mpl_toolki... |
232936789 | import Blowfish
import TtIED
import time
import os, psutil
def main():
infile = 'message.txt'
img_file = 'output.png'
outfile = 'out_message.txt'
# with open('message.txt') as S:
# print("Plaintext message:", S.read())
# print('Encoding...')
start = time.time()
TtIED.encode(infil... | null | v1/Blowfish_main.py | Blowfish_main.py | py | 950 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "TtIED.encode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Blowfish.encrypt_image",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_n... |
427626197 | """capstone URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | null | capstone/urls.py | urls.py | py | 3,515 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "views.index.search_course",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "views.index",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "djang... |
53750034 | import torch.nn as nn
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
class Model(nn.Module):
def __init__(
self,
vocab_size=0,
emb_dim=0,
num_classes=1,
hidden_size=1,
num_layers=1,
dropout=0.5,
weight_matrix=No... | null | model.py | model.py | py | 2,355 | python | en | code | null | code-starcoder2 | 66 | [
{
"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.Embedding",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
302510726 | from pathlib import Path
import codecs
import json
import lyrebird
BUGIT_STORAGE = lyrebird.get_plugin_storage()
CACHE_ROOT = Path(BUGIT_STORAGE)/'cache'
LAST_SELECT_TEMPLATE_FILENAME = 'selected_template'
def get(template_key):
return _read_cache_from_file(template_key)
def put(template_key, data):
_save... | null | lyrebird_bugit/cache.py | cache.py | py | 1,181 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lyrebird.get_plugin_storage",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"... |
88948002 | # https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
import json
class TreeNode(object):
def __init__(self, x,left=None,right=None):
self.val = x
self.left = left
self.right = right
# do a bfs
# store a complete tree
# time limit exceeded for a case
class Codec:
def s... | null | 297_Serialize_and_Deserialize_Binary_Tree.py | 297_Serialize_and_Deserialize_Binary_Tree.py | py | 2,722 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dumps",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 52,
"usage_type": "call"
}
] |
134718653 | # -*- coding: utf-8 -*-
import logging
from django.db import models
from owncloud import Client as NextcloudClient
from addons.base import exceptions
from addons.base import institutions_utils as inst_utils
from addons.base.institutions_utils import (
InstitutionsNodeSettings,
InstitutionsStorageAddon
)
from ... | null | addons/nextcloudinstitutions/models.py | models.py | py | 10,931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "addons.nextcloudinstitutions.apps.FULL_NAME",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "addons.nextcloudinstitutions.apps",
"line_number": 21,
"usage_type": "... |
512038278 | from typing import List
from enum import Enum
from . import helperfuncs
class Robot:
def __init__(self, miner):
self.miner = miner
self.goalPos = None
self.state = 'init'
if miner.owner.base_tile.tile_east:
self.side = 'right'
else:
self.side = 'left'
def moveToward(self, goal... | null | games/coreminer/robot.py | robot.py | py | 5,116 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 106,
"usage_type": "name"
}
] |
498114446 | from monte_carlo import *
import numpy as np
print("=========================")
print("Len of Bins")
print(len(top_list))
print(len(mid_list))
print( len(jun_list) )
print( len(bot_list) )
print( len(sup_list))
m = 1000
n = 1000
orig_team = []
#declare list of teams
i = 0
while i<m:
temp = teamselect()
or... | null | Monte Carlo/monte_tests.py | monte_tests.py | py | 1,679 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.empty",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.hist",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
528422081 | # -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
urlpatterns = [
# 使用 pycharts 库 绘图,并在 Web 页面展示3D图形...
url(r'^pychart3d/$', views.pyechart3d, name='pychart3d'),
# 使用 echarts.js 渲染,并在 Web 页面展示折线图...
url(r'^linechart/$', views.linechart, name='linechart'),
... | null | echartapp/urls.py | urls.py | py | 708 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.... |
23923597 | import numpy as np
import cv2
import copy
import pickle
gap = 30
D = (-5, 15)
def normalize(arr):
ans = copy.copy(arr)
return (ans - ans.min()) / (ans.max() - ans.min()) * 255.
bestPrev = np.load("bestPrev.npy")
bestCost = np.load("bestCost.npy")
shape = pickle.load(open("shape.p", "rb"))
newDis = np.zeros(... | null | HW2/dp_backward.py | dp_backward.py | py | 777 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "copy.copy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 16,
... |
425771592 | import unittest
import warnings
from selenium import webdriver
from i8自动化测试框架.comment.pageDriver import Action
from i8自动化测试框架.case.MI8.test_采购合同信息 import pcm3_cnt_m
from i8自动化测试框架.case.MI8.test_预付款单 import fc_prepay
# 缺少:采购合同计量结算
from i8自动化测试框架.case.MI8.test_发票台账 import itm3_invo_bill
from i8自动化测试框架.case.MI8.test_付款单 i... | null | i8自动化测试框架/page/采购合同结算及付款流程自动化脚本.py | 采购合同结算及付款流程自动化脚本.py | py | 1,611 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "w... |
485306007 | import urllib.request, json
import json
import numpy as np
#import pycountry as pc
import pandas as pd
import csv
import itertools
import plotly.plotly as py
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
init_notebook_mode(connected=True)
#EXTRACTING DA... | null | pyfront-master/back.py | back.py | py | 3,999 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plotly.offline.init_notebook_mode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "urllib.request.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 17,
"usage_type": "attribute"
... |
242684626 | # coding=utf-8
from keras import backend as K
import numpy as np
from keras.engine.topology import Layer
from keras.models import Model
from keras.layers import Input, Conv2D, MaxPooling2D, Activation
from keras.applications.vgg16 import VGG16
from utils import reshape_layer
from rpn_msr.proposal_layer import p... | null | RPN.py | RPN.py | py | 3,411 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers.Input",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.laye... |
461223012 | from __future__ import annotations
import asyncio
import json
import logging
import typing
import websockets
class Node:
endpoints: typing.List
def __init__(self):
self.endpoints = []
super(Node, self).__init__()
def broadcast_all(self, msgs):
msgs = json.dumps(msgs)
for... | null | NetUtils.py | NetUtils.py | py | 1,496 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"lin... |
304808215 | # -*- coding:utf-8 -*-
import time
import csv
import pymysql
def parse_dsv(infile):
"""
解析dsv数据
:params infile: dsv文件路径
"""
with open(infile, encoding='utf-8', newline='') as f:
reader = csv.reader(f, delimiter='\t')
for row in reader:
if not row[0] == 'geneId':
... | null | disgenet_v4.py | disgenet_v4.py | py | 5,122 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymysql.connect",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_n... |
590031691 | # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!! This file is not actually in use anymore !!!
# It is just kept for now in case I want to port some of the old code
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# postprocessing of data received from image recognition
# o... | null | f1telemetry/postprocessing.py | postprocessing.py | py | 17,408 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.close",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 103,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.close",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "... |
235598105 | from setuptools import setup, find_packages
INSTALL_REQUIREMENTS = [
"numpy==1.18.1",
"numba==0.48.0",
"mlflow==1.6.0",
"xarray==0.15.0",
"scipy==1.4.1",
"matplotlib==3.1.3",
]
setup(
name="vlapy",
version="1.0",
packages=find_packages(),
url="",
license="MIT",
author="... | null | setup.py | setup.py | py | 538 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
104868028 | import numpy as np
from scipy.special import gamma
from sklearn.preprocessing import MinMaxScaler
from pkg.suggestion.cma.src.handle_boundary import cal_boundary_param, cal_penalty, set_boundary_weights
def sum_of_sign(array, sign):
if sign == "positive":
flag = (array >= 0).astype("int32")
else:
... | null | pkg/suggestion/cma/src/cma_algorithm.py | cma_algorithm.py | py | 7,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.append",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.log",... |
381985846 | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 28 09:48:41 2018
@author: Govind Singh
"""
import pandas as pd
from matplotlib import pyplot as pt
import numpy as np
data = pd.read_csv('Position_Salaries.csv')
X = data.iloc[:, 1:2].values
Y = data.iloc[:, 2].values
from sklearn.ensemble import RandomForestRegressor... | null | RandomForest/rf.py | rf.py | py | 777 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.ensemble.RandomForestRegressor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": ... |
255277769 | import os
# Disable tensorflow INFO messages, show only warnings and errors
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
#################################################################
import tensorflow as tf
from tensorflow import keras
import numpy as np
from utils import plot_epochs
import matplotlib.pyplot as plt
... | null | train.py | train.py | py | 3,563 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras.optimizers.Adam",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.optimizers",
"line_number": 19,
"usage_type": "attribute"
},
{
"... |
386423545 | from django.db.models import Q
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404, render
from . import tree_utils
from .coding_systems import CODING_SYSTEMS
from .definition import Definition, build_html_definition
from .models import Codelist
def index(request):
q = re... | null | codelists/views.py | views.py | py | 2,450 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Codelist.objects.filter",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Codelist.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "models.Codelist",
"line_number": 14,
"usage_type": "name"
},
{
"api_n... |
190960071 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 28 02:13:47 2020
@author: nyein
"""
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense,Dropout,Flatten,Conv2D,MaxPooling2D
from pathlib import Path
import numpy as np
import pandas as pd
import os
from keras.datasets i... | null | multidata_testing/.ipynb_checkpoints/client_util-checkpoint.py | client_util-checkpoint.py | py | 5,634 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 28... |
218068597 | import math
import random
import secrets
import matplotlib.pyplot as plt
import numpy as np
import sympy
from tifffile.tifffile import imwrite
import tiff_manipulations as tm
def return_sum_enc(vector):
sum_of_elem = ''
for i in range(0, len(vector)):
sum_of_elem = sum_of_elem + vector[i]
return s... | null | tiff_encrypting.py | tiff_encrypting.py | py | 7,034 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tiff_manipulations.Tiff_manipulations",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "nu... |
392984952 | import xlrd
import xlsxwriter
import time
import re
from pyxlsb import convert_date
from openpyxl import *
from openpyxl.workbook import Workbook
from openpyxl.styles import Font, Fill, PatternFill
'''
Changelog v1.1
- Added total trips calculation for each day into every sheet when running option 2.
- Add... | null | Old Versions/TaxiBooking_Compiled_1.1.py | TaxiBooking_Compiled_1.1.py | py | 17,254 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "xlsxwriter.Workbook",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line... |
569418087 | import os
import xlwt
import pandas as pd
import operator
from classes import Paddler, Boat
from openpyxl import load_workbook
def TotalWeight(Side):
weight = 0;
for i in range(0,len(Side)):
weight = weight + Side[i].Weight
return weight
InputFileName = raw_input('Input name of file (include .x... | null | Program.py | Program.py | py | 8,107 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "classes.Paddler",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "operator.attrgetter",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "operator.a... |
34858242 | '''
Pawel Jocko
5937677
COSC 3P71
Assignment 3
'''
import sys
import math
from random import uniform, random
from operator import itemgetter
from recordclass import recordclass
# Particle structure (Position, Velocity, Personal Best Solution)
Particle = recordclass('Particle', 'pos vel bestPos bestValu... | null | ParticleSwarmOptimization/PSO.py | PSO.py | py | 5,964 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "recordclass.recordclass",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "math.exp",
"line_nu... |
221998448 | #!/usr/bin/env python
# encoding: utf-8
"""
测试 读取 FT境外债券投资台账
@version: v1.0
@author: Jeffrey Wang
@license: Apache Licence
@contact: shwangjj@163.com
@file: Test_Load_GL0100.py
@time: 2018/5/1 0001 下午 20:41
"""
import unittest
import os
import tools.DbUtlis as db
from cmbc_ft.sourceDataDealer.FT_Dealer impo... | null | src_testcase/test_sourceDataDealer/Test_Load_FT.py | Test_Load_FT.py | py | 1,237 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",... |
310373448 | # ==================================================================================
# Copyright (c) 2019 Nokia
# Copyright (c) 2018-2019 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | null | integration_tests/receiver.py | receiver.py | py | 2,824 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
40539859 | # Copyright (c) 2016-2017 Adobe Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | null | umapi_client/legacy.py | legacy.py | py | 10,654 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "api.Action",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "error.ArgumentError",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "error.ArgumentError"... |
49832875 | from django.urls import path
from django.contrib.auth import views as auth_views
from . import views
app_name = 'system'
urlpatterns = [
path('', views.home, name='home'),
path('about/', views.about, name='about'),
path('terms/', views.terms, name='terms'),
path('view_books/', views.viewbooks, name='v... | null | src/system/urls.py | urls.py | py | 1,055 | python | en | code | null | code-starcoder2 | 66 | [
{
"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",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
424119049 | #coding=utf-8
'''统计两个文件中的节目信息,分别编号,并保存文件'''
from pyspark import SparkContext
sc = SparkContext("local","Statistic Program Information")
nextSharePCFile='/input/PCInput'
nextShareTVFile='/input/TVInput'
inputPCFile = sc.textFile(nextSharePCFile)
inputTVFile = sc.textFile(nextShareTVFile)
inputFile = inputPCFile.unio... | null | next/Pre/StatisticProgram.py | StatisticProgram.py | py | 1,299 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyspark.SparkContext",
"line_number": 6,
"usage_type": "call"
}
] |
552898104 | import logging
logging.basicConfig(level=logging.DEBUG, filename='log.log', filemode= 'w')
#by default hierarchy for logging
# DEBUG
# INFO
# Warning
# error
# critical
def division(a,b):
try:
return a/b
except ZeroDivisionError:
logging.error(f'cannot be divided by zero')
return None
... | null | ExceptionHandling/Log.py | Log.py | py | 421 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "logging.error",
"line_number": 15,
"usage_type": "call"
}
] |
191271388 | from __future__ import division
from brian2 import *
import matplotlib.pyplot as plt
start_scope()
k = 10
N = 100
a = 0.8 # contant current injection, if non stochastic, and a>1 spontaeous firing with T = log(a/(a-1))*tau_m
tau_m = 30 * ms # membrane time constant
eqs = '''
dv/dt = (a-v)/tau_m + 0.1 * xi * tau_m *... | null | model1.py | model1.py | py | 1,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.show",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 57,
"usage_type": "name"
}
] |
199495936 | import json
import urllib
from django.conf import settings
from django.contrib import auth, messages
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth.models import User
from django.contrib.messages import get_messages
from django.contrib.sites.shortcuts import get_cur... | null | src/users/views.py | views.py | py | 10,526 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.View",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "django.utils.encoding.force_text",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "django.utils.http.urlsafe_base64_decode",
"line_number": 39,
"usage_type": "ca... |
99804028 | import pygame
from airplanegame import *
#游戏的初始化
pygame.init()
screen = pygame.display.set_mode((480,700))
bg = pygame.image.load("C:\\Users\\12091\\source\\repos\\py_game\\py_game\\images\\background.png")
#blit:绘制图像
screen.blit(bg,(0,0))
#update:更新屏幕显示
#pygame.display.update()
hero = pygame.image.load("C:... | null | py_game/py_game/py_game.py | py_game.py | py | 1,523 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.loa... |
291787461 | import json
from urlparse import parse_qsl
from sqlite3 import connect
from cgi import FieldStorage
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_path = os.path.join(BASE_DIR, "magnit.db")
class App(object):
def __init__(self):
#URL mapping
self.router = {'/regions':self.re... | null | app.py | app.py | py | 4,056 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
532021032 | try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
from Utils.Helper import DBUtility
import threading
class BaseModel(threading.Thread):
def __init__(self):
super(BaseModel, self).__init__()
self.db_util = DBUtility()
def insert(self, table... | null | News/NewsModel/BaseModel.py | BaseModel.py | py | 5,962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Thread",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Utils.Helper.DBUtility",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 125,
"usage_type": "call"
}
] |
102223688 | import time
import kivy
from firebase import firebase
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.p... | null | app.py | app.py | py | 2,987 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "kivy.require",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "kivy.properties.ObjectProperty",
"line_number": 20,
"usage_type": "call"
},
{
"api_name... |
216723183 | from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst')) as f:
long_description = f.read()
with open(path.join(here, 'VERSION')) as f:
version = f.read().strip()
with open('requirements.txt') as f:
requirements = f.read().split... | null | setup.py | setup.py | py | 931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
75817595 | # -*- coding: utf-8 -*-
# vim: set et sts=2:
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole res... | null | slapos/grid/svcbackend.py | svcbackend.py | py | 8,121 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "supervisor.xmlrpc.SupervisorTransport",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "supervisor.xmlrpc",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "xmlrpclib.ServerProxy",
"line_number": 48,
"usage_type": "call"
},
{
"api... |
235877446 | import os
import glob
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy.stats import zscore
index = []
def csv_read(file_name):
import csv
emgdata = []
with open(file_name, 'rt') as f :
data = csv.reader(f)
for row in data:
emgdata.append(row)
emgdata = np.array(em... | null | train4.py | train4.py | py | 7,866 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 34,
... |
534459191 | #!/usr/bin/python
# Solved by Bogdan Trif @
#The Euler Project https://projecteuler.net
'''
Efficient exponentiation - Problem 122
The most naive way of computing n**15 requires fourteen multiplications:
n × n × ... × n = n**15
But using a "binary" method you can compute it in six multiplications:
n × n ... | null | Project EULER/pb122 - Efficient exponentiation.py | pb122 - Efficient exponentiation.py | py | 16,770 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyprimes.factorise",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "gmpy2.is_prime",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pyprimes.primes_below",
... |
648515993 | from django.contrib import admin
# local imports
from apps.adopcion.models import Persona
@admin.register(Persona)
class PersonaAdmin(admin.ModelAdmin):
list_display = (
"nombre",
"apellidos",
"edad",
"telefono",
"email",
"domicilio",
)
list_filter = ( "nomb... | null | apps/mascota/admin.py | admin.py | py | 382 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 6,
"usage_type": "call"
},
{
... |
108491131 | ##############################################################################
#
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# This license has been certified as Open Source(tm).
#
# Redistribution and use in source and... | null | CMF/branches/CMF-1_0-branch/CMFDefault/DublinCore.py | DublinCore.py | py | 13,876 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "OFS.PropertyManager.PropertyManager",
"line_number": 94,
"usage_type": "name"
},
{
"api_name": "DateTime.DateTime.DateTime",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": "Acquisition.aq_base",
"line_number": 227,
"usage_type": "call"
},
{
... |
206712667 | import itertools
class FPNode(object):
def __init__(self, name, count, parent):
self.name = name
self.count = count
self.parent = parent
self.link = None
self.children = []
def has_child(self, name):
for node in self.children:
if node.name == name:
... | null | big_data/Association_rule_algo/FP-growth.py | FP-growth.py | py | 5,799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.combinations",
"line_number": 108,
"usage_type": "call"
}
] |
207871318 | # -*- coding: utf-8 -*-
import os
import sqlite3 as sqlite
conn = sqlite.connect("gdata/test-2.3.sqlite")
conn.enable_load_extension(True)
conn.execute('SELECT load_extension("mod_spatialite.so.7")')
cursor = conn.cursor()
sql = '''SELECT Name, AsText(Envelope(Geometry)) FROM Regions LIMIT 5'''
cursor.execute(sql)
[... | null | pygis_src/ch07_database/sec04/test_7_4_3_envelope.py | test_7_4_3_envelope.py | py | 346 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 6,
"usage_type": "call"
}
] |
574807570 | """
This module is responsible for creating a database
and adding training data to it. Training data is acquired from the yale B face-data.
Idea:
Add random 70% of each subject to the database.
Therefore extract the face, compute the feature-vector and save it to the database.
Also save the pose-information to the da... | null | FaceDetection_FaceRecognition/Modules/DB_Helper.py | DB_Helper.py | py | 11,968 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "io.BytesIO",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "numpy.save",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "sqlite3.Binary",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": ... |
359412789 | #!/usr/bin/python
import sys
sys.path.append("../py_modules")
sys.path.append("../")
import scipy.interpolate as scp
import numpy as np
import path_parm as ptp
import read_cloudnet as rc
def get_atm(cloudnet_folder, date, year, month, day, hour, minute):
#Deklariere die Variablen
ice_... | null | apriori/apriori.py | apriori.py | py | 6,912 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
1339026 | # encoder_TCN
import tensorflow.keras as keras
import numpy as np
import pandas as pd
import time
from utils.utils import save_logs
from tcn import TCN
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
from tensorflow.compat.v1.keras.backend import set_session
import... | null | classifiers/encoder_tcn.py | encoder_tcn.py | py | 7,276 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.compat.v1.ConfigProto",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1.Session",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 23,
"usage_type": "name"
},
{
... |
557654812 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 3 21:55:38 2021
@author: Nikhil
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 21:38:43 2020
@author: Nikhil
"""
from rdflib import Graph, Literal, RDF, URIRef,Namespace
from rdflib.namespace import XSD,OWL,RDFS
import pandas as pd
import random
... | null | pipeline/sparql_test_left.py | sparql_test_left.py | py | 8,097 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forex_python.converter.CurrencyRates",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "rdflib.Graph",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rdflib.Namespace",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rd... |
216527644 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 20 17:54:54 2019
@author: PC_Wardat
"""
import keras
from keras import optimizers
from keras.models import Sequential
from keras.layers.core import Dense,Activation
from keras.optimizers import SGD
import numpy as np
model = Sequential()# two layers
model.a... | null | Benchmark/StackOverflow/31556268/Correct Code/31556268.py | 31556268.py | py | 1,114 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.models.Sequential",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Dense",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "keras.layers.core.Activation",
"line_number": 16,
"usage_type": "call"
},
{
"api_... |
42839321 | import tushare as ts
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# print sys.getdefaultencoding()
# ipython notebook中默认是ascii编码
import matplotlib as mpl
from matplotlib.font_manager import FontProperties
myfont = FontProperties(fname=r'C:\Windows\Fonts\simhei.ttf', size=10)
sns.set(font=... | null | turn.py | turn.py | py | 2,720 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.font_manager.FontProperties",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_n... |
601527159 | from django.contrib.messages.api import error
from django.shortcuts import redirect, render
from .models import Show
from time import strftime
from django.contrib import messages
from datetime import date
def shows(request):
context = {
'shows': Show.objects.all()
}
return render(request, 'shows.html', conte... | null | semi_restful_app/views.py | views.py | py | 2,921 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Show.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Show.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Show",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.s... |
640525035 | import aiohttp
import aiofiles
async def webRequest(link):
"""Effectue une requête Get sur un lien donné."""
async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=3.0)) as session:
async with session.get(link) as reponse:
if reponse.status!=200:
return False
... | null | Core/Fonctions/WebRequest.py | WebRequest.py | py | 1,617 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientTimeout",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aioht... |
470498699 | import numpy as np
import pandas as pd
from collections import Counter, defaultdict
from sklearn import mixture, decomposition, metrics, cluster, preprocessing
df_emplo = pd.read_csv("data/unemployment_by_zip.csv")
df_emplo.columns = ["zip", "unemployed", "number"]
df_popul = pd.read_csv("data/population_densisty_ar... | null | data_wrangling.py | data_wrangling.py | py | 2,908 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
... |
355345122 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 4 17:30:58 2019
@author: Kiran Raikar
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].valu... | null | Part 2 - Regression/Section 6 - Polynomial Regression/polynomial.py | polynomial.py | py | 1,200 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 29,
"usage_type": "call"
... |
603838049 | from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import *
from .serializers import *
from rest_framework import status
from django.http import Http404
from rest_framework import permissions
from DetectionApp.detect import image_detect... | null | CommunityApp/views.py | views.py | py | 3,814 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.IsAuthenticated",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 17,
"usage_type"... |
582408775 | # Parsing command line arguments
import argparse
import os
import subprocess
# Handling CSV operations
import csv
from prettytable import PrettyTable
from termcolor import colored
# Function to display the banner
def banner():
print(colored("""
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|P|e|n|t|e|s|t|P|a|c|k|a|g|e|
+-+-+-+-+-... | null | dev-mightnotworkyet/ike.py | ike.py | py | 3,705 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "termcolor.colored",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "subprocess.Time... |
508111217 | import sys
from copy import deepcopy
import pytest
import numpy as np
from numpy import isclose
from numpy.random import random, randint
from flare import env, struc, gp
from flare.kernels.utils import str_to_kernel_set
from .fake_gp import generate_mb_envs
list_to_test = ['2', '3', '2+3', 'mb', '2+3+mb']
list_type ... | null | tests/test_kernel.py | test_kernel.py | py | 5,386 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.random",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
... |
327991778 | """
Common functions for sloth2tf.py and sloth2yolo.py to get data from the Sloth
JSON file.
"""
import os
import json
import math
import struct
import imghdr
import random
def getJson(file):
"""
Load the JSON file
"""
with open(file, 'r') as f:
data = json.load(f)
return data
def findFil... | null | sloth_common.py | sloth_common.py | py | 3,721 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"... |
250836481 | # -*- coding: utf-8 -*-
'''
g2p.py
created 2016 - 08 - 11
Written by Jaekoo Kang
jaekoo.jk@gmail.com
Modified by Hyungwon Yang
EMCS labs
This script converts Korean graphemes to romanized phones
and then to pronunciation.
(1) graph2phone(graphs): convert Korean graphemes to romanized phones
(2) phone2prono(phones... | null | Korean_FA/main/local/g2p.py | g2p.py | py | 4,245 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_n... |
503365290 | # Displays the number of brackets need to match all brackets.abs
from collections import deque
def bracket_match(bracket_string):
br_stack = deque()
closing_br = 0
for br in bracket_string:
if br == '(':
br_stack.append(br)
elif br == ')':
if not br_stack:
closing_br += 1
con... | null | Python/Match_Bracket.py | Match_Bracket.py | py | 412 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
199494296 | # THIS PROJECT IS AN EXAMPLE APP. SOME CODE MAY NOT BE ACTUALLY USEFUL
# FOR DEMONSTRATION PURPOSES ONLY
# YOUR MILEAGE MAY VARY
# Requirements are Flask, Flask-WTF, Flask-SQLAlchemy, bcrypt
import os
from flask import (Flask,
Blueprint,
redirect,
render_templa... | null | dockerized-gists/d354ab69398ab84f72f9e0b8c712ffb6/snippet.py | snippet.py | py | 8,618 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlch... |
1968112 | """
The module for the driver to calculate metrics related to Think Analytics resystemout component.
"""
from pyspark.sql.functions import regexp_extract
from pyspark.sql.types import StructField, StructType, TimestampType, StringType
from common.basic_analytics.basic_analytics_processor import BasicAnalyticsProcesso... | null | src/applications/basic_analytics/think_analytics/resystemout_driver.py | resystemout_driver.py | py | 1,647 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.basic_analytics.basic_analytics_processor.BasicAnalyticsProcessor",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.regexp_extract",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "common.basic_analytics.aggregations... |
618172666 | """
pathUtils
=========
This is a set of simple routines to help with extracting information from
the outlines of glyphs.
"""
from beziers.path import BezierPath
from beziers.line import Line
from beziers.point import Point
def get_bezier_paths(font, glyphname):
"""Retrieve beziers from a glyph
Args:
... | null | fontFeatures/pathUtils.py | pathUtils.py | py | 2,799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "beziers.path.BezierPath.fromDrawable",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "beziers.path.BezierPath",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "beziers.line.Line",
"line_number": 61,
"usage_type": "call"
},
{
"ap... |
528987421 | """
This spider is a Allstarjobs spider created on top of the ATSSpider
scrapy crawl allstarjobs -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.allstarjobs.ca/index.php?action=search&order_by=&ord=&2=&5=&15=&search=Find"
sample job url:
http://www.allstarjobs.ca/index.php?post... | null | brightcorp/brightcorp/spiders/allstarjobs.py | allstarjobs.py | py | 5,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "brightcorp.base.atsspiders.ATSSpider",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 32,
"usage_type": "call"
},
{
"api_name... |
96806293 | from fabric.contrib.files import sed
from fabric.decorators import task
from fabric.operations import run
from fabtools import deb, require, service
from . import files
__all__ = ['dist_upgrade', 'set_hostname']
@task
def dist_upgrade():
deb.update_index(quiet=True)
deb.upgrade(safe=False)
def install_fai... | null | fabfile/common.py | common.py | py | 751 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fabtools.deb.update_index",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fabtools.deb",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fabtools.deb.upgrade",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fabtools.... |
384731302 | """
This module contains unit tests of add_neighbor().
"""
import collections
from typing import List, Deque
import pytest
from node import Peer, Neighbor
from ..__init__ import (
ENGINE_SAMPLE,
SCENARIO_SAMPLE,
create_a_test_peer,
create_test_peers,
)
@pytest.mark.parametrize("scenario,engine", [(... | null | test/node/test_add_neighbor.py | test_add_neighbor.py | py | 2,607 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "node.Peer",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "__init__.create_test_peers",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "node.Neighbor",
... |
187814539 | import pandas as pd
import lib.messages as msg
import re
import json
# NOTE: check headers of file against our sample feed.
# TODO: Add check against attributes in processHeaders
def processHeaders(file):
headerRule = checkHeaders(file)
if len(headerRule) > 0:
msg.printWarning("These are not proper h... | null | lib/rules.py | rules.py | py | 6,220 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lib.messages.printWarning",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lib.messages",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "lib.messages.printOkay",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lib.mes... |
341568677 | from email.utils import parsedate_tz
import imaplib
import email
import re
import base64
from libs.key_values_scan import keys_list
from libs.subscription import subscription
from config import MAIL_SERVICE, MAIL_LOGIN, MAIL_PASSWORD
def get_data() -> any:
# --- Connection
mail = imaplib.IMAP4_SSL(MAIL_S... | null | one_mail_ya.py | one_mail_ya.py | py | 4,816 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "imaplib.IMAP4_SSL",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.MAIL_SERVICE",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "config.MAIL_LOGIN",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "confi... |
503596950 | # -*- coding: utf-8 -*-
#%%
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import StandardScaler
import pandas as pd
from tensorflow import keras
#%%
from sklearn.datasets import load_boston
housing = load_boston()
#%%
from sklearn.model_selection import train_test_split
... | null | chapter_2/4_widedeep_keras_functional_API.py | 4_widedeep_keras_functional_API.py | py | 1,728 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.datasets.load_boston",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 19,
"usag... |
554876053 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import shortuuid, os
"""
Helpers.
usage sample:
import miller.helpers
print helpers.echo()
"""
def create_short_url():
return shortuuid.uuid()[:7]
def get_whoosh_index():
from django.conf import settings
from whoosh.index import create_in, exists_in, open... | null | miller/helpers.py | helpers.py | py | 1,378 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "shortuuid.uuid",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "whoosh.fields.Schema",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "whoosh.fields.TEXT",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "whoosh.fields.... |
20532265 | # This is my breakout game.
from turtle import Screen
from block import Block
from paddle import Paddle
from ball import Ball
from scoreboard import Scoreboard
import time
# -------------------- GAME SCREEN SETUP -------------------- #
screen = Screen()
screen.bgcolor("black")
screen.setup(width=780, he... | null | Day86-Breakout/main.py | main.py | py | 2,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "turtle.Screen",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "paddle.Paddle",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ball.Ball",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scoreboard.Scoreboard",
"li... |
548011602 | # !/usr/bin/python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from lab2 import VERSION
__author__ = 'asaskevich'
setup(name='lab2',
version=VERSION,
description='BSUIR, Python, Lab 2',
author='Alex Saskevich, 353501',
author_email='asaskevich@xbsoftware.com',
ur... | null | kurs_3/sem_1/IGI/lb/Laboratornaya_2/Лабораторная 2/setup.py | setup.py | py | 902 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lab2.VERSION",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "setuptools.find_packages",
"line_number": 15,
"usage_type": "call"
}
] |
352400218 | from .base import Page
from selenium.webdriver.common.by import By
from common_modules.common_functions import get_data, is_element_exist
from random import randint
from .adminloginPage import AdminLogin
import time
class WebSalePage(Page):
"""
购买页面,一直到付款页面
"""
def __init__(self, driver):
... | null | selenium_learning/pages/salePage.py | salePage.py | py | 1,947 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base.Page",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "base.Page.__init__",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base.Page",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "common_modules.common_functions... |
415352443 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.decomposition import FastICA, PCA, FactorAnalysis
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.random_projection import GaussianRandomProjection
from yellowbrick.features.pca import PCADecomposition
... | null | 02a_reduction.py | 02a_reduction.py | py | 4,234 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.shape",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 16,
... |
299117935 | #!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from pyinventory import InventoryClient
from pyinventory.api.equipment_type import (
add_equipment_type,
get_or_create_equipme... | null | symphony/cli/tests/pyinventory_tests/test_equipment_type.py | test_equipment_type.py | py | 1,345 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.base_test.BaseTest",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pyinventory.InventoryClient",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "grpc.rpc_pb2_grpc.TenantServiceStub",
"line_number": 19,
"usage_type": "name"
},
... |
542389389 | import json
import re
from aocd import data
def sum_of_numbers_in_text(s):
return sum(int(n) for n in re.findall(r"-?\d+", s))
def rsum(data):
if isinstance(data, int):
return data
elif isinstance(data, dict):
if "red" in data.values():
return 0
return rsum(list(data... | null | aoc_wim/aoc2015/q12.py | q12.py | py | 502 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.findall",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "aocd.data",
"line_number": 12,
"usage_type": "argument"
},
{
"api_name": "aocd.data",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aocd.data",
"line_number": 14,
... |
278168404 | # -*- coding: utf-8 -*-
"""
Created on 10.9.2012
@author: huqa // Ville Riikonen <pikkuhukka@gmail.com>
@copyright Copyright (c) 2012,2014 Ville Riikonen
@license BSD
"""
from ..lib import pvm
from math import ceil, sqrt
from operator import itemgetter
import logging
log = logging.getLogger("pvm")
def command_pvm(b... | null | pyfibot/modules/module_pvm.py | module_pvm.py | py | 2,145 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "operator.itemgetter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line... |
463909791 | # -*- coding: UTF-8 -*-
from __future__ import print_function
import pickle
import os.path
import time
import re
import httplib2
import requests
from bs4 import BeautifulSoup
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import R... | null | python3/drive/upload.py | upload.py | py | 5,395 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path.pat... |
490823832 | import numpy as np
from numba import njit
from scipy.special import erf
import multiprocessing as mp
from scipy.optimize import curve_fit
from functools import partial
import logging
from tqdm import tqdm
logger = logging.getLogger('Analysis')
np.warnings.filterwarnings('ignore')
def init_outs(n_hits):
hit_dty... | null | tjmonopix/analysis/analysis_utils.py | analysis_utils.py | py | 25,637 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.warnings.filterwarnings",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.warnings",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "n... |
487296460 | import numpy as np
import matplotlib.pyplot as plt
import plotting_utls as pltuls
#utility functions for algorithm implementation and testing.
def create_ranges(start, stop, N):
divisor = N-1
steps = (1.0/divisor) * (stop - start)
return steps[None,:]*np.arange(N)[:,None] + start[None,:]
def normalize(A):... | null | muscle_synergies/util.py | util.py | py | 5,074 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number... |
26024323 |
# publish sync signal corridor data to Socrata
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import arrow
from copy import deepcopy
import agol_helpers
import knack_helpers
import socrata_helpers
import email_h... | null | sync_corridor.py | sync_corridor.py | py | 4,383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.sys",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_n... |
242528970 | import matplotlib.pyplot as plt
import numpy as np
import pandas
import os
# Format display float number
pandas.options.display.float_format = "{:.0f}".format
# Walmart key to description test file
walmart_key = 'Work4WalmarT'
# Path of train file
path_train = os.path.join('data', 'train.csv')
# Read dataset
datase... | null | analysis.py | analysis.py | py | 3,063 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.options",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"l... |
606753666 | import os
from scipy.io import savemat
from readPVT import GetRTs
def csv_post_del(s):
l = list(s)
del(l[-4:])
s = ''.join(l)
return s
if not os.path.exists('rt-result'):
os.mkdir('rt-result')
for i in range(3):
os.mkdir('./rt-result' + str(i + 1))
for i in os.listdir('./pvt-rt'):
... | null | pvt-process.py | pvt-process.py | py | 590 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_number": 16... |
247763460 | from django.shortcuts import render
from django.http import HttpResponse,HttpResponseRedirect
from .models import WordDetail,WordForms,Translations,CompTranslations
from django.core.paginator import Paginator
# Create your views here.
def index(request):
return render(request,'word/index.html')
def words(request,num=1... | null | word/views.py | views.py | py | 1,689 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.WordDetail.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.WordDetail.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
... |
507267860 | #!/usr/bin/env python
''' Module for calculating running means of time series data
Author: Dominic Fuller-Rowell (NOAA/NCEI),'''
try:
# Try importing the required python modules.
from numpy import *
from numbers import Number
from math import ceil, floor
from logging import warning
from date... | null | lib/ncei/goesr/data/average_data.py | average_data.py | py | 7,306 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 51,
"usage_type": "argument"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "da... |
587763856 | #!/usr/bin/python3
from setuptools import setup
from Cython.Build import cythonize
with open('README.md') as f:
readme = f.read()
setup(
name='larda',
version='0.1.0',
description='Python package for prediction of lidar backscatter and depolarization using cloud radar Doppler spectra.',
long_descr... | null | setup.py | setup.py | py | 1,344 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Cython.Build.cythonize",
"line_number": 25,
"usage_type": "call"
}
] |
290244705 | #NATIVE IMPORTS
import os
import glob
import argparse
from collections import deque
from itertools import count
import random
import time
#OPEN SOURCE IMPORTS
import cv2
import numpy as np
import torch
import torch.nn.functional as F
from sklearn.feature_extraction import image
from skimage.util.shape import view_as_w... | null | trainM/base/train.py | train.py | py | 12,728 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 59,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.init.xavier_uniform_",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "t... |
308887042 | from jproperties import Properties
class ReadPropertiesObject():
def __init__(self,path):
#self.object_constant=constant
self.configs = Properties()
self.object_properties=self.get_property_object(path)
def get_property_object(self,path):
try:
with open(path,'rb') a... | null | AlertAndPopup/alert_and_popup/object_repository/read_properties_object.py | read_properties_object.py | py | 932 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jproperties.Properties",
"line_number": 6,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.