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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
488639420 | #!/usr/bin/python3
#-*- coding: utf-8 -*-
import os
import sys
import sqlite3
from tkinter import *
from tkinter.messagebox import *
from tkinter.scrolledtext import *
###############################################################################
### classe principale du répertoire
###################################... | null | repertoire_telephonique/repertoire.py | repertoire.py | py | 17,200 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.exit",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 124,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 124,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_nu... |
488113519 | import h5py as h5
import numpy as np
import os
import matplotlib
#This performs mean subtraction and divides each image by its standard devation, so each image is centered at zero and has a std of 1
def mean_subtract(dataset):
s = dataset.shape #get the shape
m = np.mean(dataset, axis = (1, 2)) #get ... | null | V2/Code/make_norm.py | make_norm.py | py | 6,556 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.mean",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 1... |
518431605 | from flask import Flask, request, redirect, url_for, render_template
from flask_modus import Modus
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = "postgres://localhost/flask-sqlalchemy-snacks"
modus = Modus(app)... | null | flask/05-sql-alchemy-1/solution/app.py | app.py | py | 1,753 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask_modus.Modus",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.redirect... |
484837933 | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'/history', views.history, name='history'),
url(r'/teamHistory', views.teamHistory, name='teamHistory'),
url(r'/timeEntry', views.timeEntry, name='timeEntry'),
url(r'/unlinkedAccount', views.unlinkedAccount... | null | timetracker/urls.py | urls.py | py | 558 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "djan... |
654112572 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def score_1 (dic) :
"""
Return the score_1 for a given product, i.e. score_1 == 1 if all nutrients predicted are correct, else 0
@ input : dic {dictionnary} A dictionnary for a product with format { nutrient : prediction(nutrient)=... | null | analyse.py | analyse.py | py | 4,640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"... |
55180835 | import base64
import requests
import os
from datetime import datetime
os.getcwd()
url = "http://api.imgur.com/3/upload.json"
token = "TOKEN"
os.system('')
filename = datetime.now().strftime('%Y-%m-%d%H:%M:%S')
t = filename + '.png'
os.system('screencapture -i ' + t)
fileadd = os.getcwd() + '/' + t
fh = open(filea... | null | screenshot.py | screenshot.py | py | 710 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"lin... |
532234760 | import torch
import numpy as np
import torch.nn as nn
import math
import time
class CNN(nn.Module):
def __init__(self, dict_dim, hidden_dim, feature_dim, conv_k_size, pool_mode, out_dim):
super().__init__()
self.dict_dim = dict_dim
self.hidden_dim = hidden_dim
self.feature_dim = fea... | null | Assignments/Homework3/code/cnn.py | cnn.py | py | 5,071 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.Embedding",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_n... |
22145113 | from compost import Compost
def empty_bucket(bucket_name):
"""Destructive helper."""
import boto
from boto.s3.bucket import Bucket
bucket = Bucket(connection=boto.connect_s3(), name=bucket_name)
for key in bucket.get_all_keys():
key.delete()
def test_compost():
"""
Test the very ... | null | tests/test_compost.py | test_compost.py | py | 1,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "boto.s3.bucket.Bucket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "boto.connect_s3",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "compost.Compost",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "compost.list",
... |
179307019 | from c2g.models import Exam, ExamScore
from django.db.models import Count, Q
from datetime import datetime
def gen_spec_in_line_report(report_name, course):
if report_name == 'quizzes_summary':
now = datetime.now()
exams = Exam.objects.values('title').filter(~Q(exam_type=... | null | main/courses/reports/generation/gen_in_line_reports.py | gen_in_line_reports.py | py | 2,276 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "c2g.models.Exam.objects.values",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "... |
171374649 | """Ingest the SchoolNet data coming via the NWN socket feed
1) Ingest data into per station per day text files
2) Send wind alerts
"""
from __future__ import print_function
# Python Imports
import re
import time
import datetime
import telnetlib
import os
import shutil
import traceback
import logging
import smt... | null | scripts/snet/ingest.py | ingest.py | py | 14,711 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyiem.util.get_dbconn",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "psycopg2.extras.extras",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.extras",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "log... |
357636918 | from flask_wtf import Form
from wtforms import TextAreaField, validators
from wtforms.validators import DataRequired
def checkNumeric(form,field):
approved=[' ',',','[',']','+','-','/','*','j',';']
flag=False
for char in field.data:
if char in approved or char.isnumeric():
flag=False
... | null | app/forms.py | forms.py | py | 640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wtforms.validators.ValidationError",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "wtforms.validators",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask_wtf.Form",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "... |
363312962 | import sqlite3
from employee import Employee
conn = sqlite3.connect(':memory:') # this way is better for testing. creates a fresh database in memory. it is useful because we dont have to comment out create tables or inserting data.
# conn = sqlite3.connect('employee.db') # it creates the file even it does not exist... | null | Standard Library/SQLite3/sql.py | sql.py | py | 2,699 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "employee.Employee",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "employee.Employee",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "employee.Employee"... |
77512859 | import tensorflow as tf
from keras.preprocessing.sequence import pad_sequences
from keras.layers import Dense,Embedding,Dropout,Flatten
from keras.layers import Dense, Flatten, LSTM, Conv1D, MaxPooling1D, Dropout, Activation
from keras.layers import Input,concatenate
from keras.models import Model
from keras.models imp... | null | Multi_Class/multipblstm.py | multipblstm.py | py | 5,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "string.punctuation",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "pandas.read_c... |
149691805 | #!/usr/bin/env python
# coding: utf-8
# ## 决策树的直接调用与Titanic数据集的探索
# In[ ]:
# 必要的引入
get_ipython().run_line_magic('matplotlib', 'inline')
import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# In[ ]:
# #### 读取数据并打印基本信息
data = pd.read_csv("titanic.csv", sep=",")
# In... | null | decision-tree-exercise-2.py | decision-tree-exercise-2.py | py | 5,127 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "seaborn.countplot",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "seaborn.countplot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.qcut",
... |
613565252 | import torch
from torchvision import utils
import time
import datetime
import numpy as np
def log_time(msg):
print(msg)
print('\t', end='')
print('Datetime: {}'.format(datetime.datetime.now()), end='\n')
def log_images(x, y, out, path, batch_size, window_size):
with torch.no_grad():
... | null | utils/log.py | log.py | py | 1,537 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.no_grad",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.spli... |
111711708 | import requests
import json
from model import Stock,DBSession
import GLOBAL
def get_all_stock_list():
stock_list = []
for param in GLOBAL.params:
marked = param["marked"]
type = param["type"]
list = get_stock_list(marked, type)
print("marked:{0},type:{1},count:{2}".format(mark... | null | src/stock_list.py | stock_list.py | py | 1,335 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "GLOBAL.params",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "GLOBAL.stock_list_url.format",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "GLOBAL.stock_list_url",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_nam... |
277617962 | from gensim.models import Word2Vec
import multiprocessing as mul
import numpy as np
import time
import pickle
import numpy as np
from keras.models import Sequential
from keras.layers import Conv1D, MaxPooling1D, Flatten, Input, Embedding
from keras.losses import categorical_crossentropy
from keras.optimizers import Ada... | null | Extract_feature_source.py | Extract_feature_source.py | py | 2,889 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_numb... |
352278736 | from troposphere import Template, Output, Ref, AWS_STACK_NAME, Join, Export, GetAtt, AWS_REGION
from troposphere.apigateway import RestApi, Resource, Method, Integration, MethodResponse, IntegrationResponse, \
Deployment, Stage, ApiKey, StageKey, UsagePlan, QuotaSettings, ThrottleSettings, ApiStage, UsagePlanKey, \... | null | templates/cms.py | cms.py | py | 13,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "troposphere.Template",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "troposphere.s3.Bucket",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "troposphere.dynamodb.Table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
642466531 | import numpy as np
import theano
import theano.tensor as T
from theano import shared
np.random.seed(50)
datax=np.random.rand(50,3)
datay=np.asarray([i[0]*2+i[1]*i[2] for i in datax]).reshape((50,1))
datay=(datay-np.min(datay))/(np.max(datay)-np.min(datay))
# datax = [[0, 0, 1], [0, 1, 0], [1, 0, 0]]
# datay = [[0, 0, 1... | null | Reducing the Dimensionality of Data.py | Reducing the Dimensionality of Data.py | py | 1,871 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
349370569 | import re
import os
import hashlib
from tqdm import tqdm
import json
from nltk.tokenize import sent_tokenize
import argparse
"""将dm处理成squad的形式"""
def hashhex(s):
h = hashlib.sha1()
h.update(s.encode("utf-8"))
return h.hexdigest()
def greedy_selection(doc_sent_list, abstract_sent_list, ... | null | data/write_sum2squad.py | write_sum2squad.py | py | 10,953 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hashlib.sha1",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 138,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 138,
... |
313845462 | from genome import dot
from genome import chaser
import sys
import pygame as pg
import random as r
import threading
population_dot=30
population_chaser=5
pg.init()
screen = pg.display.set_mode((1200, 800))
dots=[]
chasers=[]
for x in range(population_dot):
dots.append(dot())
for x in range(population_chaser):
... | null | main.py | main.py | py | 1,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "genome.dot",
... |
245959982 | import json
from datetime import datetime, timezone, timedelta
from bidict import bidict
from notion.client import NotionClient
from notion.collection import NotionDate
from todoist.api import TodoistAPI
class task:
def __init__(self,
source=None,
task_id=None,
... | null | notion2doist/tools.py | tools.py | py | 32,627 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "todoist.api.TodoistAPI",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "notion.client.NotionClient",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "datetime... |
359372987 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Client(models.Model):
STATUS_DELETED = 0
STATUS_ACTIVE = 1
STATUS_CHOICES = (
(STATUS_DELETED, _(u'Deleted')),
(STATUS_ACTIVE, _(u'Active'))
)
TYPE_BUYER = 0
TY... | null | apps/sp/models/Client.py | Client.py | py | 2,536 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 12,
"usage_type": "call"
},
{
... |
196138980 | # -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2011-2017 German Aerospace Center (DLR) and others.
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distributi... | null | src/tools/turn-defs/connections.py | connections.py | py | 15,802 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "sumolib.xml.pa... |
278761100 | from nipype.pipeline.engine import Node, Workflow
from nipype.interfaces.utility import IdentityInterface
from nipype.algorithms.modelgen import SpecifySPMModel
from nipype.interfaces.fsl import Level1Design as fsl_design
from nipype.interfaces.fsl.maths import MathsCommand
from nipype.interfaces.fsl import (
FEATM... | null | bairanalysis/workflows/glm/temporalpatterns.py | temporalpatterns.py | py | 3,345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "nipype.pipeline.engine.Node",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.utility.IdentityInterface",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nipype.pipeline.engine.Node",
"line_number": 16,
"usage_type": "c... |
43831951 | from django.shortcuts import render
from django.http import HttpResponse,JsonResponse
from .models import Books
from redis_con import BCNRedis
# Create your views here.
def index(request):
return HttpResponse("Home page")
def get_list(request):
con=BCNRedis()
#caches['default'].set('pattam','tesss')
... | null | rest_framework_testing/rest/views.py | views.py | py | 1,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "redis_con.BCNRedis",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "r... |
578273886 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
from scipy.sparse import diags as diags
from scipy.sparse.linalg import spsolve as spsolve
class laplacian_solver:
def __init__(self, dim_row, dim_col, b_condition, b_direction = None):
"""
... | null | classes/laplacian_solver.py | laplacian_solver.py | py | 3,955 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.sparse.linalg.spsolve",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.diags",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.arra... |
199561227 | from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, request
from django.views import generic
from django.views.generic import TemplateView
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django import forms
from .models import ... | null | Bookface/FirstProjectRefactor/views.py | views.py | py | 9,049 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.cont... |
435823552 | import multiprocessing as mp
from pathlib import Path
import subprocess
import sys
import numpy as np
from libmuscle import Instance, Message
from ymmsl import Operator
from .conftest import skip_if_python_only
def run_macro(instance_id: str):
sys.argv.append('--muscle-instance={}'.format(instance_id))
mac... | null | integration_test/test_cpp_macro_micro.py | test_cpp_macro_micro.py | py | 2,489 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv.append",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "libmuscle.Instance",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ymmsl.Operator.O_I",... |
259468728 | from flask import jsonify, request
from . import api_1_0 as bp
from app.api import Field, InvalidUsage, MyForm, api, caps, get_model, validators
from db import database as db
from db.model import CorpusCode, RecordingPlatform
@bp.route("corpuscodes/<int:corpus_code_id>", methods=["GET"])
@api
@caps()
@get_model(Corp... | null | app/api/v1_0/corpus_codes.py | corpus_codes.py | py | 1,218 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.jsonify",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "db.model.CorpusCode.dump",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "db.model.CorpusCode",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "app.api.ap... |
408798428 | import numpy as np
import cv2
import glob
import os
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
from scipy.signal import convolve2d as conv2
from skimage import color, data,restoration
from scipy import ndimage
from numpy import seterr
seterr(divide='ignore')
################## C... | null | main.py | main.py | py | 7,936 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.seterr",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.fft.fft2",
"line_numb... |
427382805 | from django.shortcuts import render, render_to_response
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.db.models import Avg, Max, Count
from django.contrib.auth.mod... | null | binny/db/views.py | views.py | py | 1,362 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db.forms.FoundBinForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 21,
"usage_type": "call"
},
... |
626197514 | import json
import re
import MySQLdb
json_data=open('/home/RestCommander/restcommander-master/AgentMaster/app_logs_adhoc/20140328151754217-0600~ADHOCDATASTORE_NODEGROUP_20140328151749787-0600~MULTI_124_CALL.jsonlog.txt')
data = json.load(json_data)
data_str=str(data)
list_a=['catalog/video/guide','network-settings/ac... | null | py code/Multi_Call_124.py | Multi_Call_124.py | py | 1,796 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 26,
"usage_type": "call"
}
] |
625490281 | from django.shortcuts import render
from django.contrib import messages
from rest_framework import viewsets
from .serializers import VehicleSerializer
from .models import Vehicle, VehicleData
from .filters import VehicleFilter
class VehicleViewSet(viewsets.ModelViewSet):
queryset = Vehicle.objects.all()
seria... | null | datalogger/views.py | views.py | py | 2,762 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Vehicle.objects.all",
"line_number": 10,
"usage_type": "call"
},... |
84272522 | #!/usr/bin/python3
import numpy as np
from keras import models, layers
from keras.datasets import boston_housing
(train_data, train_targets), (test_data, test_targets) = boston_housing.load_data()
print("Shape of training data: {}".format(train_data.shape))
print("Shape of test data: {}".format(test_data.shape))
pr... | null | scripts/3.7-predicting-house-prices.py | 3.7-predicting-house-prices.py | py | 1,778 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.datasets.boston_housing.load_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "keras.datasets.boston_housing",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "keras.models.Sequential",
"line_number": 23,
"usage_type": "call"
}... |
348126381 | import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
filename = "results_50_epochs"
df_stats = pd.read_csv(filename+".csv")
columns = df_stats.columns
win_first = df_stats.iloc[:,[0]].values
win_second = df_stats.iloc[:,[1]].values
lose_first = df_stats.iloc[:,[2]].values
lose_second = df_sta... | null | generate_stats.py | generate_stats.py | py | 980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "matplotli... |
213796792 | """marsabit URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/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 | adgg_tz/urls.py | urls.py | py | 3,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 23,
"usage_type": "name"
},
{
"api_name... |
371384306 | import json
from unittest import SkipTest
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
from venom import Message
from venom.fields import Int64, String, Int32
from venom.rpc import Service, http
from venom.rpc.comms.aiohttp import create_app
from venom.rpc.test_utils import mock_venom
class Aio... | null | tests/rpc/comms/test_aiohttp_server.py | test_aiohttp_server.py | py | 4,461 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "aiohttp.test_utils.AioHTTPTestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "venom.Message",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "venom.Message",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "venom.... |
18920440 | from frontend.globals import WIDTH, HEIGHT, COLOR_TEXT
from pygame import display, font, Surface, draw
from pygame.sprite import LayeredUpdates
from backend import EventHandler, System
from .constants import COLOR_BG
class Renderer:
widgets = None
on_selection = False
selection = None
typem... | null | frontend/globals/renderer.py | renderer.py | py | 2,054 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.display.set_caption",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pyg... |
429778718 | #!/usr/bin/env python3
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import matplotlib
import pandas as pd
import sys
import glob
import warnings
warnings.filterwarnings("ignore")
#matplotlib.use('Agg')
plt.rcParams['figure.figsize'] = 12, 26
SMALL_SIZE = 8
MEDIUM_SIZE = 10
BIGGER_SIZE = 12
plt.rc... | null | python/plot_black_box.py | plot_black_box.py | py | 8,923 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name... |
98262113 | # We will be doing two methods of analysis on the handwritten data set:
# Principal Component Analysis
# AND
# Neural Networks
#######
######
#####
####
###
##
# FIRST SECTION: GATHER DATA
##
###
####
#####
######
#######
# First let's get the data
# And import the module from scikit learn that will do this
import ... | null | MNIST.py | MNIST.py | py | 10,310 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.datasets.fetch_mldata",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "sklearn... |
422167846 | from Graph import *
import numpy as np
from numpy import Inf, exp
from scipy.integrate import quad
from scipy.stats import norm
from scipy.optimize import fminbound
from statistics import mean
from math import sqrt, log, e, erf
from itertools import product
import time
class EPBP:
# Expectation particle belief p... | null | inferer/EPBPLogVersion.py | EPBPLogVersion.py | py | 11,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.exp",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "math.erf",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.clip",
"line_number": 65,
... |
415515662 | from PIL import Image
from torch.optim.lr_scheduler import _LRScheduler
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch import nn
import torch.nn.functional as F
import torch
import numpy as np
from torch.autograd import Variable
import torchvision.transforms as T
import collections
import lightgbm as... | null | MushroomsRecognition/imgt/utils.py | utils.py | py | 15,802 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.optim.lr_scheduler._LRScheduler",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.optim.lr_scheduler.ReduceLROnPlateau",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "torch.nn.Module",
"line_number": 82,
"usage_type": "attr... |
80424453 | import os, sys, logging
from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
from azure.identity import DefaultAzureCredential
def main():
export_to_blob()
def export_to_blob(source_path,source_file_name):
try:
#set up logging of data
logger = logging.getLo... | null | DataTool/ETL Of Data Warehouse Data/ETL Of Data Warehouse Data/blob_export.py | blob_export.py | py | 2,255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.getenv",
... |
57385355 | '''
Initializes the attributes of the packetDict object
Starts the packet dict with an empty dictionary
The constructor for the packetDict class
takes a packet object and a fieldName
The field name is the first line of the header
which details the HTTP method and URL
Parameters:
boolean printAll - If True, print a... | null | tokenTracer/assembler.py | assembler.py | py | 9,050 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tracer.logger.debug",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "tracer.logger",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "tracer.logger.debug",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "tracer.logger",... |
191821133 | import socket
import threading
import time
from sys import argv
import logging
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s] %(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
filename='ttt_server.log');
console = logging.StreamHandler();
console.setLevel(logging.INFO);
logging.getLogger('')... | null | serverttt.py | serverttt.py | py | 6,866 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.IN... |
90708159 | import sys
import numpy as np
import pandas as pd
from easydict import EasyDict as edict
sys.path.append('../src')
import const
from factory import get_fold
from utils import DataHandler
from feature_utils import save_features, TargetEncoding
cfg = edict({
'name': 'KFold',
'params': {
'n_splits': 5,
... | null | src/make_features/53_target_encoding.py | 53_target_encoding.py | py | 1,769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "easydict.EasyDict",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.DataHandler",
... |
310971090 | # "QG" Quasi-Geostrophic model.
#
# Taken from Sakov's enkf-matlab package. See
# Sakov, Pavel, and Peter R. Oke.:
# "A deterministic formulation of the ensemble Kalman filter:
# an alternative to ensemble square root filters."
# Tellus A 60.2 (2008): 361-371.
#
# - ψ is the stream function (i.e. surface eleva... | null | mods/QG/core.py | core.py | py | 2,847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 65,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"line_... |
198554719 | from sgmllib import SGMLParser
#from html.parser import HTMLParser
class GetIdList(SGMLParser):
def reset(self):
self.IDlist = []
self.flag = False
self.getdata = False
self.verbatim = 0
SGMLParser.reset(self)
def start_div(self, attrs):
... | null | sgmllib.py | sgmllib.py | py | 2,119 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sgmllib.SGMLParser",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "sgmllib.SGMLParser.reset",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sgmllib.SGMLParser",
"line_number": 9,
"usage_type": "name"
}
] |
377354209 | import json
from collections import OrderedDict
import click
class ConfigKeys:
"""
Define the string literals to be used as keys in the JSON config file.
"""
image_size_pix = 'image_size_pix'
cell_size_arcsec = 'cell_size_arcsec'
kernel_support = "kernel_support"
kernel_exact = "kernel_ex... | null | src/fastimgproto/scripts/config.py | config.py | py | 1,168 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "click.argument",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "click.File",
... |
20163631 | from django.urls import path
from . import views
app_name = 'movies'
urlpatterns = [
path('', views.main, name='main'),
path('index/', views.index, name='index'),
path('search/<str:sort>/', views.search, name="search"),
path('index/<str:sort>/', views.index, name='index_sort'),
path('<int:movie_p... | null | movies/urls.py | urls.py | py | 814 | python | en | code | null | code-starcoder2 | 76 | [
{
"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",
... |
599717404 | import os
from flask import Flask, request, jsonify, abort
from sqlalchemy import exc
import json
from flask_cors import CORS
from functools import wraps
from database.models import db_drop_and_create_all, setup_db, Drink
from auth.auth import AuthError, requires_auth
app = Flask(__name__,instance_relative_config=Tru... | null | main.py | main.py | py | 6,655 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "database.models.setup_db",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "database.models.... |
179234288 | """empty message
Revision ID: 0cdcbf16c7ba
Revises: 1911cc6c9b15
Create Date: 2018-10-07 12:58:31.999486
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0cdcbf16c7ba'
down_revision = '1911cc6c9b15'
branch_labels = None
depends_on = None
def upgrade():
# ... | null | migrations/versions/0cdcbf16c7ba_.py | 0cdcbf16c7ba_.py | py | 658 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
463305260 | import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
## data = pd.read_excel(r'E:\Python Work\iss_data_90minutes.xlsx')
## print(data)
# Thanks to Daniel I found out I don't need to call the same file each time, instead use a function that already calls the worksheet, and grab d... | null | Graphing Practice.py | Graphing Practice.py | py | 1,903 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_excel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "matplotl... |
313983697 | from django.shortcuts import render, render_to_response
from static.models import Static
from django.db.models import Sum
# Create your views here.
def stat(request):
dict={}
dict['statics']=Static.objects.all()
dict['right']=Static.objects.aggregate(Sum('static_right')) #sum of column
dict['wrong']=Static.objects.... | null | static/views.py | views.py | py | 633 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "static.models.Static.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "static.models.Static.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "static.models.Static",
"line_number": 7,
"usage_type": "name"
},
{
... |
219671433 | import syntax
import logic
from logic import Solver, Expr
import utils
import z3
from typing import Callable, List, Optional
def translate_transition_call(s: Solver, key: str, key_old: str, c: syntax.TransitionCall) -> z3.ExprRef:
prog = syntax.the_program
ition = prog.scope.get_definition(c.target)... | null | src/trace.py | trace.py | py | 2,897 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logic.Solver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "syntax.TransitionCall",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "syntax.the_program",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.... |
112817740 | import requests
import urllib
import random
class Vituttaa:
def __init__(self):
self.commands = { 'vituttaa': self.getVitutus, 'viisaus': self.getViisaus }
self.vituttaaUrl = 'https://fi.wikipedia.org/wiki/Toiminnot:Satunnainen_sivu'
self.viisaudet = self.readViisaudet()
def getCommand... | null | vituttaa.py | vituttaa.py | py | 1,255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.sample",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib.parse.unquote_plus",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
... |
565099810 | # coding=utf-8
import json
import xarray as xr
import numpy as np
class EvaluateFunction():
""" Evaluation function class
All evaluation functions are to find the maximum value.
Attributes:
da: xarray type, contains all information of the data set
dims: list type, list of the parameter na... | null | thpo/evaluate_function.py | evaluate_function.py | py | 5,665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "xarray.DataArray.from_dict",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "xarray.DataArray",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "numpy.arra... |
256230866 | #! /usr/bin/env python3
# <<BEGIN-copyright>>
# Copyright 2022, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
"""
Translate GNDS/XML to HDF5. Each xml element becomes a group in HDF, except a few elements that ... | null | bin/XMLtoHDF.py | XMLtoHDF.py | py | 4,890 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.string_",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.string_",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.uint32",
... |
47547953 | import hashlib
import json
from .serializables import PaySerializers, RechargeSerializers, SmsCallbackSerializers,PaymentSerializers
from django.http import HttpResponse
from django_redis import get_redis_connection
from rest_framework.generics import GenericAPIView, CreateAPIView
from django.utils import timezone
impo... | null | up_down_chain/up_down_chain/app/Pays/views.py | views.py | py | 8,852 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework.generics.GenericAPIView",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "serializables.PaySerializers",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "xmltodict.parse",
"line_number": 41,
"usage_type": "call"
},
{
... |
183984818 | #!/usr/bin/python
import os
from base import BaseScraper
from BeautifulSoup import BeautifulSoup
import json
from trailpeak_raw_html import ScrapeTrailPeakRawHTML
from trailpeak_gpx import ScrapeTrailPeakGPX
class ScrapeTrailPeakDetails(BaseScraper):
def __init__(self):
BaseScraper.__init__(self)
... | null | scrapers/trailpeak_details.py | trailpeak_details.py | py | 1,903 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.BaseScraper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "base.BaseScraper.__init__",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "base.BaseScraper",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "trailpeak... |
276224996 | from __future__ import print_function
import keras
import numpy as np
import os
import pickle
from keras import backend as K
from keras import backend as K
from keras import optimizers
from keras import regularizers
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Concatenate, concatenate
from keras.... | null | RISAN-Code/models/RISAN_catdog_wa.py | RISAN_catdog_wa.py | py | 13,404 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.layers.Input",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "keras.regularizers.l2",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "keras.re... |
224882598 | import discord
from discord.ext import commands
import time
from cogs.utils.logger import Logger
class Calculation:
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=["temp"])
async def temperature(self, degrees: float):
"""Convert between Celsius and Fahrenheit"""
... | null | cogs/calculation.py | calculation.py | py | 3,416 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.command",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "discord.Embed",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "disco... |
38233954 | """
Sphinx plugins for Django documentation.
"""
from sphinx import addnodes
from sphinx.domains.std import Cmdoption
def setup(app):
app.add_crossref_type(
directivename="setting",
rolename="setting",
indextemplate="pair: %s; setting",
)
app.add_description_unit(
directive... | null | {{cookiecutter.project_name}}/docs/_ext/djangodocs.py | djangodocs.py | py | 765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sphinx.domains.std.Cmdoption",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "sphinx.addnodes.desc_name",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sphinx.addnodes",
"line_number": 27,
"usage_type": "name"
}
] |
165919457 | """Script to finetune vggs using Tensorflow.
Thank you for Frederik Kratzert write finetune Alexnex using tensorflow
Because my experience use a seldom framework vggs ,so i fix his code
i can use it in tensorflow with vision 1.2 or 1.4 and comes with a blog
post, which you can find here:
Author: GYxiaOH
contact: zh... | null | finetune.py | finetune.py | py | 8,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.Variable",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.exponential_decay",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tensorflow.train",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_... |
298532716 | import datetime
import json
import os,re
import time
import neo4jBenchmarkTest
from pymongo import MongoClient
import psutil
#------------- Create db connection and create database ----------------------------
def create_connection(containerName):
port_no = re.split(pattern='_', string=containerName)[-1] # <--- ... | null | Anurag/BenchmarkingNoSqlDatabases/mongodbBenchmarkTest.py | mongodbBenchmarkTest.py | py | 9,761 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.split",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
88566666 | from tkinter import *
from tkinter import ttk
from PIL import Image, ImageTk
from tkinter import messagebox
import threading
import compute_feature as compute_feature
import Student
import Recognition2 as Recognition
import cv2
import numpy as np
import dlib
from keras_vggface import VGGFace
from Transporter import *
i... | null | GUI.py | GUI.py | py | 17,155 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "compute_feature.FaceExtractor",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Recognition2.FaceIdentify",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "Student.Student",
"line_number": 27,
"usage_type": "call"
},
{
"api_name"... |
645508190 | import torch
from torch import nn
from torch.nn import functional as F
from Utils.flags import FLAGS
import numpy as np
crossentropy = nn.CrossEntropyLoss()
softmax = nn.Softmax(1)
logsoftmax = nn.LogSoftmax(1)
# some utils TODO
def update_average(model_tgt, model_src, beta=0.999):
param_dict_src = dict(model_s... | null | 0Discarded/loss_classifier.py | loss_classifier.py | py | 3,339 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Softmax",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
575799960 | import logging
import argparse
import configparser
import os
import torch
import numpy as np
import gym
import pandas as pd
from crowd_nav.utils.explorer import Explorer
from crowd_nav.policy.policy_factory import policy_factory
from crowd_sim.envs.utils.robot import Robot
from crowd_sim.envs.policy.orca import ORCA
fr... | null | crowd_nav/test.py | test.py | py | 11,124 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
... |
617660419 | import datetime
import time
import pytz
import pandas as pd
import json
import urllib.request
from tzwhere import tzwhere
from helpers import okta_to_percent, granularity_to_freq
def get_temperature_cloudcover(start_time=None, end_time=None,
granularity=None,latitude=None, longitude=None, source='we... | null | solartk/weather.py | weather.py | py | 3,586 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.date_range",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "urllib.request.... |
171758560 | import json, nltk, os, unicodedata
os.chdir('/Users/kylefth/Desktop/SILS Courses/Spring2014/541/Final_Ideas')
json_list = []
with open('gay_rights.json', 'rb') as infile:
gay_rights = json.load(infile)
json_list.append(gay_rights)
with open('abortion.json', 'rb') as infile:
abortion = json.load(infile)
... | null | scripts/loading_parsing.py | loading_parsing.py | py | 980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.chdir",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 14,
"us... |
209369672 | #comparison(比較元の選手, その選手の比較したい年)
#入力した年の全選手と比較元の選手の成績を比較して、ポイントが高い順で入力した年の全選手のリストを返す
#db_list(取得したい年)
#入力した年の全選手の成績リストをリストで返す(選手の成績は辞書型)
#ask_score(比較対象の選手の成績リスト, 比較元の選手の成績リスト)
#後者の選手を基にポイントを算出してその値を返す
import sqlite3
#dbの取得
def db_list(year):
db = 'baseball_' + year +'.db'
con = sqlite3.connect(db)
cur ... | null | comparison.py | comparison.py | py | 2,575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 15,
"usage_type": "call"
}
] |
324607238 | from datetime import datetime
from dashboard.tests.ck_editor_object import Ckeditor
from p2pu_user.models import User
from django.core.urlresolvers import reverse
from test import SeleniumTestCase
from webdriver import CustomWebDriver
class Auth(SeleniumTestCase):
def setUp(self):
# setUp is where setup ... | null | badges/dashboard/tests/selenium_tests.py | selenium_tests.py | py | 2,421 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "test.SeleniumTestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "p2pu_user.models.User.objects.create",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "p2pu_user.models.User.objects",
"line_number": 14,
"usage_type": "attribute"
... |
469843518 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Arthur Gubaidullin (http://www.lapteuh.ru)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | null | handler/image.py | image.py | py | 3,724 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.ext.blobstore.create_upload_url",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "webapp2.uri_for",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "handler.UPLOAD_IMAGE",
"line_number": 48,
"usage_type": "argument"
},
... |
174522395 | import logging
from datetime import datetime
from io import BytesIO
from typing import Dict, Generator
from zipfile import ZipFile
import scrapy
from opennem.pipelines.bulk_insert import BulkInsertPipeline
from opennem.pipelines.csv import RecordsToCSVPipeline
from opennem.pipelines.nem import ExtractCSV
from opennem... | null | opennem/spiders/aemo/mms.py | mms.py | py | 4,175 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scrapy.Spider",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "opennem.pipelines.nem.ExtractCSV",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": ... |
116539413 | # -*- coding: utf-8 -*-
'''
Execution module to provide deluge configuration to Salt
.. versionadded:: 2015.8.0
'''
import re
from salt.exceptions import CommandExecutionError
ERROR = 'The key {} is invalid!'
RET_RE = '^\s*{}: (?P<value>.*)$'
__virtualname__ = 'deluge'
def __virtual__():
'''
Only load if ... | null | _modules/deluge_mod.py | deluge_mod.py | py | 1,114 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "salt.exceptions.CommandExecutionError",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "salt.exceptions.CommandExecutionError",
"line_number": 40,
"usage_type": "call"
}
] |
623598158 | import logging
from datetime import datetime
from django.db import models
from django.utils.text import slugify
from model_utils.models import TimeStampedModel
from events.models import Event
from .parsing import read_feed
logger = logging.getLogger(__name__)
def ustr(string):
"""
Returns the Python versio... | null | calendars/models.py | models.py | py | 2,845 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.db.models.Manager",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "mode... |
646818893 | '''
copyright (c) 2016 Nathaniel Wright
this program is free software: you can redistribute it and/or modify
it under the terms of the gnu general public license as published by
the free software foundation, either version 3 of the license, or
(at your option) any later version. you should have received a copy
of the ... | null | correlated_variability/code/sub_fig_plotting/plot_rel_pwr_spectra_all_cells.py | plot_rel_pwr_spectra_all_cells.py | py | 7,628 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "analysis.get_power_spectra_all_cells.get_power_spectra_all_cells",
"line_number": 103,
"usage_type": "call"
},
{
"api_name": "pylab.array",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "pylab.array",
"line_number": 136,
"usage_type": "call"
}... |
283060209 | import os.path
import numpy
from scipy.spatial import Delaunay
import meshio
from meshplex import MeshTri
def simple0():
#
# 3___________2
# |\_ 2 _/|
# | \_ _/ |
# | 3 \4/ 1 |
# | _/ \_ |
# | _/ \_ |
# |/ 0 \|
# 0-----------1
#
X = numpy.a... | null | test/meshes.py | meshes.py | py | 7,425 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
249320464 | import requests
from mopidy.models import Ref,Track,Album,SearchResult,Artist,Image,Playlist
from mopidy.backend import *
import pykka
import pdb
import time
logger = logging.getLogger(__name__)
import urllib
from threading import Lock
# I have learned a lot from jackyNIX's code for kodi mopidy plugin
# https://github... | null | code/mopidy/mopidymixcloud/mopidy_mixcloud/mopidy_mixcloud.py | mopidy_mixcloud.py | py | 19,951 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "threading.Lock",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "mopidy.models.Ref.directory",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "mopidy.models.R... |
151596676 | # Copyright 2020 The Kale Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | null | backend/kale/static_analysis/dependencies.py | dependencies.py | py | 14,591 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyflakes.reporter.Reporter",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pyflakes.reporter",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "pyflakes.api.check",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "pyfla... |
121508491 | # Copyright 2019-2020 The Lux Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | null | tests/test_pandas.py | test_pandas.py | py | 2,001 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.car_df",
"line_number": 32,
"usage_type": "attribute"
}
] |
101576521 | import re
import phonenumbers
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from email_validator import validate_email, EmailNotValidError
from phonenumbers import PhoneNumber
from phonenumbers.phonenumberutil impor... | null | django_simple_account/validators.py | validators.py | py | 5,777 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.search",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.core.exceptions.ValidationError",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.gettext_lazy",
"line_number": 24,
"usage_type": "call"
},
{... |
460298545 | # coding=utf-8
# !/usr/bin/env python
# Created on 2017/12/16 0016 下午 4:35
# author: 'Administrator'
# software: PyCharm
# file: move_element.py
# 脚本功能描述:悬浮
from selenium import webdriver
import time as t
from selenium.webdriver.common.action_chains import ActionChains
driver=webdriver.Firefox()
driver.maximize_window... | null | selfTest/actionchains/move_element.py | move_element.py | py | 748 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "selenium.web... |
113272152 | import fire
from typing import *
from dataclasses import dataclass
class SeatCode:
rowsize: int = 7
row_signs: List[str] = ['F', 'B']
col_signs: List[str] = ['L', 'R']
id_row_offset: int = 8
def __init__(self, code: str):
self.code = code
def _to_int(self, code: str, signs: List[str... | null | day5/run.py | run.py | py | 1,596 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "fire.Fire",
"line_number": 72,
"usage_type": "call"
}
] |
19732361 | '''Test for ratio of Poisson intensities in two independent samples
Author: Josef Perktold
License: BSD-3
'''
import numpy as np
from scipy import stats
from statsmodels.stats.base import HolderTuple
from statsmodels.stats.weightstats import _zstat_generic2
def test_poisson_2indep(count1, exposure1, count2, expo... | null | statsmodels/stats/rates.py | rates.py | py | 12,005 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sqrt",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 10... |
448161375 | # -*- coding: utf-8 -*-
import sys
import os
from backports import configparser
import json
from datetime import datetime
import talib
import numpy as np
import pymysql.cursors
# 親ディレクトリの設定
app_home = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".." ))
# パスの読み込み
sys.path.append(os.path.jo... | null | bin/make_index_batch.py | make_index_batch.py | py | 2,985 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line... |
600274402 | import json
import logging as _logging
from google.appengine.ext import ndb
from app.cache import gc_collect, clear_lru_cache
from app.decorators.cacheable import cacheable
from app.decorators.searchable import searchable
from app.json_serializer import JSONEncoder, encoder
from app.repositories import DisciplinesRepos... | null | app/api/teams.py | teams.py | py | 4,308 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.setLevel",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.WARN",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "app.cache.gc_col... |
461171748 | import cv2
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
os.getcwd()
os.chdir("C:\\F\\NMIMS\\DataScience\\Sem-3\\AI\\project\\detection")
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
eyeCascade = cv2.CascadeClassifier("haarcascade_eye.xml")
smileCascade = cv2.Cas... | null | face_detect.py | face_detect.py | py | 1,318 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"li... |
103431365 | # Ce script permet d'égaliser un histogramme de sorte à
# corriger une image qui manque de constraste
from os import system
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
from luminance import luminance
from hist import hist
def histCumulNorm(img):
""" Calcul l'histogramme c... | null | Traitement Image/egalHist.py | egalHist.py | py | 1,670 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "hist.hist",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
79672215 | import jieba
import jieba.analyse
import json
import heapq
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
from linebot.models import TextSendMessage
from db_connection import con
import numpy as np
from linebot.models import TextSendMessage
fr... | null | reply.py | reply.py | py | 2,654 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jieba.load_userdict",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "db_connection.con.cursor",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "db_connection.con",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "jieba.... |
160776236 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from __future__ import absolute_import
from __future__ import division
import os
from termcolor import colored
import datetime
import tensorflow as tf
import time
import numpy as np
import data
def ensure_exists(dire):
if not os.path... | null | utils.py | utils.py | py | 8,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tensorflow.ConfigProto",
... |
354269229 | # -*- encoding: utf-8 -*-
"""
@File : /detectron2/projects/FlowNet/demo/demo.py
@Time : 2020-11-24 23:58:33
@Author : Facebook, Inc. and its affiliates.
@Last Modified: 2020-11-25 22:20:56
@Modified By : Chen-Jianhu (jhchen.mail@gmail.com)
@License : Copyright(C), USTC
@Desc : None
"... | null | projects/FlowNet/demo/demo.py | demo.py | py | 5,659 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "detectron2.config.get_cfg",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "argparse.Argu... |
590716874 | import pandas as pd
import numpy as np
import scipy
import sklearn
import csv
from sklearn.linear_model import RidgeCV, Lasso, LassoCV, ElasticNetCV, ElasticNet
from sklearn.metrics import mean_squared_error
from sklearn import preprocessing
import matplotlib.pyplot as plt
def calc_function(values, function)... | null | main.py | main.py | py | 1,437 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.square",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number":... |
125448220 | from wilib2 import *
import asyncio
import json
import aiohttp
from pprint import pprint
from item import *
from rotation import *
from planet import *
class Mission():
def __init__(self, parent_planet, mission_name):
if type(parent_planet) is not str:
# constructed from a parent data, can grab all data from that... | null | wilib2/mission.py | mission.py | py | 1,304 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pprint.pprint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "asyncio.run",
"... |
457911000 | import sys
import os
import torch
import numpy as np
def voxelize_lidar(lidar_data,tf_lidar_data,voxel_id_offset,voxel_map_h,voxel_map_w,num_voxels,max_pts_voxel,v_w,v_h,max_w,max_l):
valid_tf_lidar_data = tf_lidar_data[np.where(tf_lidar_data[:,2]<=0.4)[0],:]
valid_lidar_data =lidar_data[np.where(tf_lidar_data[:... | null | code/voxelize.py | voxelize.py | py | 2,147 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.where",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_nu... |
289397475 | #!/usr/bin/env python3
"""
Author : antoniog1
Date : 2019-02-18
Purpose: Rock the Casbah
"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
description='Argparse Python script',
... | null | assignments/05-python-tictactoe/outcome.py | outcome.py | py | 1,813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 27,
"usage_type": "attribute"
},
{
... |
210827568 | import json
import os
import numpy as np
import rdkit.Chem.AllChem as rdkit
from scipy.spatial.distance import euclidean
from ...utilities import (
vector_angle,
rotation_matrix,
rotation_matrix_arbitrary_axis,
mol_from_mae_file,
remake,
periodic_table
)
class MoleculeSubclassError(Exception)... | null | src/stk/molecular/molecules/molecule.py | molecule.py | py | 41,911 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utilities.rotation_matrix_arbitrary_axis",
"line_number": 258,
"usage_type": "call"
},
{
"api_name": "utilities.rotation_matrix",
"line_number": 309,
"usage_type": "call"
},
{
"api_name": "numpy.isfinite",
"line_number": 356,
"usage_type": "call"
},
{
... |
336871128 | import logging
import os
from codem.joblaunch.args import get_step_args
from codem.metadata.model_task import ModelTask
from codem.metadata.step_metadata import STEP_IDS
from codem.ensemble.gangnam_style import best_psi, psi_weights
from codem.ensemble import PV
import codem.stgpr.space_time_smoothing as space
from c... | null | gbd_2019/shared_code/central_comp/cod/codem/codem/work_exec/OptimalPSI.py | OptimalPSI.py | py | 9,790 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "codem.metadata.model_task.ModelTask",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "codem.metadata.step_metadata.STEP_IDS",
"line_number": 28,
"usage_type": "name"
}... |
250635944 | # -*- coding:utf-8 -*-
__author__ = 'changjie.fan'
"""
项目信息管理的view
"""
from datetime import datetime,date
import json
import sys
import os
reload(sys)
sys.setdefaultencoding('utf8')
from flask import render_template, redirect, url_for, request, flash, current_app, session, send_file
from flask.ext.login... | null | tms/project/views.py | views.py | py | 44,682 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "flask.url_for",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.