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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
54096831 | import argparse
import time
import torch
import torch.nn.functional as F
import argparse
from torch.autograd import Variable
import os
import re
import model
from beam import beam_search
from common import config
from utils import remove_bpe, remove_special_tok
def load_model(checkpoint_path, net):
"""
Reloa... | null | config/base.fp16.active_base.heuristic/translate.py | translate.py | py | 3,127 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isfile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number"... |
553165421 | import os
import zipfile
import subprocess
from multiprocessing import Pool, cpu_count
def create_dir(dir_path):
if not os.path.isdir(dir_path):
os.makedirs(dir_path)
return
parent_dir = os.path.dirname(os.getcwd())
data_dir = os.path.join(parent_dir, "data", "Asgeir UCSF", "Zipped DICOM")
unzipped_... | null | src/test/decompress.py | decompress.py | py | 1,846 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_numbe... |
435753057 | """utils.py - Helper functions for building the model and for loading model parameters.
These helper functions are built to mirror those in the official TensorFlow implementation.
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and ... | null | test_improve_22.py | test_improve_22.py | py | 59,991 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 53,
"usage_type": "argument"
},
{
"api_name": "torch.nn.S... |
162034344 | from qiskit import Aer
#visualize??
from qiskit.visualization import plot_state_city
from qiskit import *
qc = QuantumCircuit(3)
# Run the quantum circuit on a statevector simulator backend
backend = Aer.get_backend('statevector_simulator')
# Create a Quantum Program for execution
job = execute(qc, backend)
resul... | null | cs810/sample_circuit_aer.py | sample_circuit_aer.py | py | 439 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "qiskit.Aer.get_backend",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "qiskit.Aer",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "qiskit.visualization.plot_state_city",
"line_number": 20,
"usage_type": "call"
}
] |
532584961 | import sqlite3
import os
global local_run_id
import json
from init_client import handle_config
#############################################################
#############################################################
# Managing initialization and resetting of database
class manage_database():
# cursor object
c... | null | Client_Linux/database_management.py | database_management.py | py | 8,701 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_numb... |
126078119 | # coding: utf-8
import datetime
from django import forms
from django.contrib import messages
from django.db.models import F
from django.db import transaction
from django.shortcuts import HttpResponseRedirect
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, ButtonHolder, Sub... | null | kf_apps/checkout/forms.py | forms.py | py | 5,501 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "voucher_shop.models.Voucher",
"line_number": 21,
"usage_type": "argument"
},
{
"api_name": "django.db.transaction.commit_on_success",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.db.transaction",
"line_number": 22,
"usage_type": "name"
... |
214481769 | from matplotlib import pyplot, rcParams, cm, colors
from mpl_toolkits.mplot3d import axes3d
pyplot.xkcd()
import timeit
from Relax import *
from Direct import *
# Formating vectors
solvers = [[laplace_jacobi, laplace_gauss, laplace_SOR], \
[ poisson_jacobi, poisson_gauss, poisson_SOR], \
[nonlinear_jacobi, n... | null | CavityPy/Analyze.py | Analyze.py | py | 9,412 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.xkcd",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "timeit.Timer",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
524413013 | import os,sys
from numpy import pi,array,zeros,linspace,sqrt,arctan,sin,cos,tan,tanh,ceil,floor,where,\
amin,amax,argmin,argmax,exp,mean,divide
from matplotlib.pyplot import plot,show,subplots,savefig,xlabel,ylabel,clf,close,xlim,ylim
from numpy.linalg import norm
from numpy import degrees as deg
from numpy import ... | null | pythonModeling/launch/torqconv.py | torqconv.py | py | 3,670 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.pi",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "subs.smoothedTable",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_nu... |
440160969 | #!/usr/bin/python3
# sentdex tutorial for machine learning
# https://www.youtube.com/watch?v=JcI5Vnw0b2c&list=PLQVvvaa0QuDfKTOs3Keq_kaG2P55YRn5v&index=2
# a feature is an attribute that makes up a label
# a label is something we want to be able to predict into the future
# a group of features (featureset) is the input... | null | lesson1-4-comments_regression.py | lesson1-4-comments_regression.py | py | 3,209 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "quandl.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,... |
207635324 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from IPython.display import HTML
#表示するグラフの作成
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_ylim(0, 20)
ax.set_xlim(-10, 10)
ax.set_xlabel('ground')
ax.set_ylabel('height')
#ax.grid()は不要なので入れない
#dotへの初期値代入
dot, = ax.plot(... | null | main.py | main.py | py | 3,796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numpy.sin",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"l... |
65729267 | import numpy as np
from cvxopt import matrix, spmatrix, sparse, spdiag
from models.data import DPixelLinel as D
from models.dataCheck import memoryCheck, dataStats
from models.utils import extendSparse, extendMatrix
U = matrix( D._U, (D.numVars,1),'d' )
V = matrix( D._V, (D.numVars,1),'d' )
P = spmatrix( D._P_values, ... | null | app/PythonApplications/convex-solver/models/MLinearizedPixelLinel.py | MLinearizedPixelLinel.py | py | 1,851 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cvxopt.matrix",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.data.DPixelLinel._U",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.data.DPixelLinel",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "mo... |
88186936 | # -*- coding: utf-8 -*-
from django.shortcuts import render
from .models import Materials
from .forms import PostForm
from .tables import PostsTable
from django.contrib import messages
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render,get_object_or_404,redirect
from django.d... | null | trt_django/src/trtmaterial/views.py | views.py | py | 3,576 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.PostForm",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 22,
"usage_type": "name"
},
{
"api_name":... |
477891342 | from django.urls import path
from . import views
urlpatterns = [
path('', views.EventListView.as_view(), name='event_list'),
path('Committee <int:pk>/event/', views.createEvent, name='create_event'),
path('<int:pk>/event_detail', views.EventDetailView.as_view(), name='event_detail'),
path('<int:pk>/Ne... | null | events/urls.py | urls.py | py | 369 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
624801334 | from typing import Optional
class CityMindData:
property: Optional[dict]
consumer: Optional[str]
provider: Optional[str]
serial_number: Optional[str]
last_read: Optional[float]
consumption: Optional[float]
monthly_consumption: Optional[float]
consumption_estimation: Optional[float]
... | null | custom_components/citymind_water_meter/models/citymind_data.py | citymind_data.py | py | 1,573 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Optional",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"l... |
224645657 | import logging
from google.appengine.ext import deferred
from google.appengine.ext import ndb
from models import AppUser
BATCH_SIZE=220
def cleanup_run(cursor=None, num_updated=0):
logging.warn('cleanup_run::Start')
query = AppUser.query(ndb.GenericProperty('e') != '')
if cursor:
logging.warn('cl... | null | cleanup_run.py | cleanup_run.py | py | 1,013 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.warn",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.AppUser.query",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.AppUser",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.... |
288862512 | # pylint: disable=too-few-public-methods
from django.db import models
from django.utils.translation import gettext as _
class TimestampedModel(models.Model):
"""
Abstract base class with the fields created and modified both indexed.
"""
created = models.DateTimeField(
_("Created"),
au... | null | src/drft/models.py | models.py | py | 593 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 11,
"usage_type": "call"
},
{
"api_nam... |
400356289 | # Copyright 2016: C. Delaere
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | null | opentsdbclient/tests/test_objects.py | test_objects.py | py | 30,160 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "requests.exceptions.HTTPError",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "testtools.TestCase",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "time.time... |
457268414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/4/24 下午4:05
# @Author : yizhen
# @Site :
# @File : data.py
# @Software: PyCharm
import json
import sys
import numpy as np
import torch
import copy
from alphabet import Alphabet
from datautils import get_index
from datautils import read_instance, p... | null | src/data.py | data.py | py | 10,037 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "alphabet.Alphabet",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout.... |
284137237 | import urllib.request, json
import urllib.parse
import itertools
import pandas as pd
from django.conf.locale import nn
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import display
from pandas import DataFrame
import pulp as pp
class GoogleMapAPI:
def __init__(self, origin,
... | null | pathfinding/nn.py | nn.py | py | 6,700 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.parse.quote_plus",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib.request.parse",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 25,
"usage_type": "name"
},
{
"api_name... |
306785700 | import sys
import pygame as pg
from state import State
class SplashScreen(State):
def __init__(self):
super(SplashScreen, self).__init__()
self.persist["screen_color"] = "black"
self.next_state = "MENU"
pg.display.set_caption("Loading")
def get_event(self, event):
... | null | Assignments/P02/splash_state.py | splash_state.py | py | 619 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "state.State",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.QUIT... |
613621715 | import scapy.all as scapy
from multiprocessing import Pool
import os
clear = os.system('clear')
print("**************************************")
print(" UDP_Flood")
print("**************************************")
print("Please input your target's IP ")
target = input("[UDP_Flood]#")
p = {}
def UDP_Flood_E... | null | scapy-test/DDOSAttackProtection/UDP_Flood.py | UDP_Flood.py | py | 932 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.system",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "scapy.all.IP",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scapy.all",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "scapy.all.UDP",
"line_number": 29... |
326255340 | import numpy as np
from matplotlib import pyplot as plt
def get_rho(mat):
mm=mat[1:-1,1:-1]
mm=mm-0.25*(mat[0:-2,1:-1]+mat[2:,1:-1]+mat[1:-1,0:-2]+mat[1:-1,2:])
return mm
R=1.0
d=5.0
ncoeff=10;
aa=np.arange(1,ncoeff)*1.0
alpha=R/d
coeffs=-(alpha**aa)/aa #we got this by looking at the Fourier transform o... | null | problem_sets/cylinder_wire.py | cylinder_wire.py | py | 1,770 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_num... |
587731156 | import os
from multiprocessing import Pool
from utils import call_eldarica,plot_scatter
import json
import numpy as np
def get_evaluations_from_eldarica_pool(fun,file_list,parameters,countinous=True):
parameter_list=[]
if countinous == True:
for file in file_list:
if os.path.exists(file+".me... | null | Heuristic_selection/src/measurement_functions.py | measurement_functions.py | py | 7,824 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "utils.call_eldarica"... |
647522284 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/ditz/files.py
# Compiled at: 2016-11-27 06:27:17
"""
File utilities.
"""
import sys, yaml, codecs, six
from datetime import datetime... | null | pycfiles/pyditz-0.10.3-py2.7/files.py | files.py | py | 3,802 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "codecs.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number... |
391247277 | ############################################
# Dog Detection Project
# Author : Anil Kumar S (Jan 19, 2020)
# Phone: 8891869515
############################################
# pip install tensorflow==1.14
import cv2,os,time
import argparse
import numpy as np
yolo_class="../yolo_v3/yolov3.txt"
yolo_weig... | null | raspberry pi single codes/person detection/person_count.py | person_count.py | py | 3,524 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.rectangle",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.putText",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
... |
212107385 | import numpy as np
from keras.layers import *
from keras.models import Model
from keras import backend as K
import imageio,os
#from keras.datasets import mnist
from keras import losses
from sklearn.cluster.k_means_ import KMeans
from sklearn import manifold
from sklearn.utils.linear_assignment_ import linear_assignment... | null | src/core/vaeConv2d.py | vaeConv2d.py | py | 11,424 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "keras.datasets.fashion_mnist.load_data",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "keras.datasets.fashion_mnist",
"line_number": 25,
"usage_type": "name"
},
{
... |
604530652 | import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import losses
from tensorflow.keras import preprocessing
import matplotlib.pyplot as plt
import numpy as np
import pickle
import os
import math
import datetime
import itertools
import copy
import random
#HYPERPARAMETERS:
initial_learning_... | null | src/best_simulation.py | best_simulation.py | py | 5,009 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.chdir",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number":... |
221806613 | from django.shortcuts import render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
import os
from django.views.generic import DetailView
from products.models import Product, ProductCategory
MODULE_DIR = os.path.dirname(__file__)
# Create your views here.
def index(request):
context ... | null | products/views.py | views.py | py | 1,415 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "products.models.Pr... |
154487868 | import requests, json
WEBHOOK_URL = "https://hooks.slack.com/services/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"
def send_slack(msg):
data = {
"channel": "#vvvv2",
"emoji": ":dog2:",
"msg": msg,
"username": "뀨하",
}
payload = {
"channel": data["channel"],
"u... | null | flask/bot/lib/slack.py | slack.py | py | 497 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.post",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
}
] |
410126083 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('youngman', '0004_remove_newbeliever_update_at'),
]
operations = [
migrations.AlterField(
model_name='newbeliever... | null | youngman/migrations/0005_auto_20150104_1337.py | 0005_auto_20150104_1337.py | py | 442 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
608433198 | """
Created on Wed Mar 7 18:50:06 2017
@author: joans
"""
import os
import numpy as np
import tensorflow as tf
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from network_factory import Network_factory
class ClassificationNetwork():
def __init__(self, image_shape, model_... | null | classification_network_old.py | classification_network_old.py | py | 7,495 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.reset_default_graph",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 34,
"usage_type": "attribute"
},
{
"api... |
352404269 | """
domain.py - Phenny Time/Zone Module
Copyright 2013, Jin Park - jinpark.net
Licensed under the Eiffel Forum License 2.
http://inamidst.com/phenny/
"""
import requests
import urllib
def domain(phenny, input):
try:
r = requests.get('http://freedomainapi.com/?key=j9eokw730j&domain=' + urllib.quote(input... | null | oldmodules/domain.py | domain.py | py | 834 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "urllib.quote",
"line_number": 15,
"usage_type": "call"
}
] |
585589448 | import os
from django.conf import settings
from django.shortcuts import redirect, render
from django.template import TemplateDoesNotExist
def comp_listing(request, directory_slug=None):
context = {}
working_dir = settings.COMPS_DIR
if directory_slug:
working_dir = os.path.join(working_dir, direct... | null | comps/views.py | views.py | py | 1,104 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings.COMPS_DIR",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
612255064 | from django.conf.urls import patterns, url
urlpatterns = patterns('domicilios.views.users.empresa',
url(r'^add/$', 'addEmpresa', name="add_empresa"),
url(r'^info/(?P<empresa_id>[0-9]+)/empresa/$', 'infoEmpresa', name="info_empresa"),
url(r'^edit/(?P<empresa_id>[0-9]+)/empresa/$', 'editEmpresa', name="edit_empresa")... | null | remplazo/domicilios/urls/users/empresa.py | empresa.py | py | 572 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "djan... |
52796690 | # -*- coding: utf-8 -*-
"""
garage.image_utils
Image-processing utility functions.
* created: 2012-08-10 Kevin Chan <kefin@makedostudio.com>
* updated: 2012-09-08 kchan
"""
import os.path
import re
import imghdr
import Image
# image utilities
DEFAULT_IMG_QUALITY = 75
RE_PATS = [
r'^(.*)([_\-][0-9]+x[0-9]+)(\.[^... | null | requirements/django-garage/build/lib/garage/image_utils.py | image_utils.py | py | 3,127 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Image.ANTIALIAS",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "Image.open",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "Image.open",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "os.path.path.join",
"l... |
643010236 | import logging
import time
def run_calcs():
i = 0
logger = logging.getLogger('process')
logger.setLevel(logging.INFO)
logger.info('process launched')
while i < 10:
i += 1
time.sleep(1)
logger.info('online')
logger.info('done') | null | std logging/simple/subpkg/process.py | process.py | py | 277 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
}
] |
375021448 | ## MPSOGSA
import train_base_model as ResNetBasics
import os
import torch
import numpy as np
from numpy import random as rnd
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.utils import shuffle
import sys
from pyts.image import RecurrencePlot
import matplotlib.pyplot as plt
import argpar... | null | MPSOGSA_ResNet.py | MPSOGSA_ResNet.py | py | 6,342 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.sqrt",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.seterr",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
537545931 | #!/usr/bin/python3
# coding: utf-8
import json, os
from excel_module import *
from tkinter import *
_state_ = {
'ban':'disable'
}
_color_ = {
'off':'white',
'on':'red',
}
def _trager_(status):
if status == 'on' or status == True:
return 'off'
else:
return 'on'
def _exclusive_(sta... | null | jinding_config_build/tmp_V03/build.py | build.py | py | 11,859 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dump",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 100,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 123,
... |
20460727 | import json
from utils.search import search_string, search_dict
from utils.processing import get_book
from utils.chapter_processing import get_chapter_head_tag
def quote_find(arg1, page_number, book, use_keywords):
"""Search and find the quote and return both the line containing the quote as well as
the nex... | null | utils/finder.py | finder.py | py | 2,850 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "utils.processing.get_book",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.search.search_string",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.chapter_processing.get_chapter_head_tag",
"line_number": 43,
"usage_type": "ca... |
355189845 | import sys, os
import logging
import numpy as np
import shutil
from smac.facade.smac_facade import SMAC
from smac.scenario.scenario import Scenario
import inspect
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]))
cmd_folder = os.path.realpath(os.path.join(cmd_... | null | scripts/extensive_tests.py | extensive_tests.py | py | 5,607 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.realpath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"li... |
464408288 | import requests
import asyncio
from asyncio import tasks
from scrappers.apps.config.http import user_agent
class UtilitiesMixin:
@staticmethod
def clean(value):
return str(value).strip()
@classmethod
def full_clean(cls, value):
return cls.clean(value).lower()
def flatten(self, val... | null | apps/config/http/utilities.py | utilities.py | py | 1,883 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scrappers.apps.config.http.user_agent.get_rand_agent",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "scrappers.apps.config.http.user_agent",
"line_number": 35,
"usage_type"... |
341282288 | # Copyright 2021 Xilinx Inc.
#
# 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 in writing, ... | null | code/test/model_darts14.py | model_darts14.py | py | 21,291 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.autograd.cuda.FloatTensor",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "torch.autograd.cuda",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "torch.autograd",
"line_number": 43,
"usage_type": "name"
},
{
"api_name"... |
581149952 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 13 13:21:23 2019
@author: oura
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 10 16:57:14 2019
@author: oura
"""
from graphviz import Digraph
G = Digraph(format='pdf')
G.attr(rankdir='LR')
G.attr('node', shape='circle')
G.node("s0")
G.node("s... | null | programs/chapter1/graphviz_image/MDP_sample.py | MDP_sample.py | py | 895 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "graphviz.Digraph",
"line_number": 17,
"usage_type": "call"
}
] |
297829385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from keras.datasets import cifar10
from resnet_18_architecture import *
from tensorflow.core.protobuf import saver_pb2
import cleverhans
from discard_code.target_attack import *
(X_train, y_train), (... | null | discard_code/resnet_18_entropy_confidence.py | resnet_18_entropy_confidence.py | py | 4,623 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.datasets.cifar10.load_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "keras.datasets.cifar10",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tensorflow.core.protobuf.saver_pb2.SaverDef",
"line_number": 24,
"usage_type": "a... |
323756832 | from typing import Any, Mapping, Optional, Union
from unittest import mock
from django.conf import settings
from sentry import features
from sentry.features import Feature
from sentry.models import User
from sentry.testutils import TestCase
class MockBatchHandler(features.BatchFeatureHandler):
features = frozen... | null | tests/sentry/features/test_manager.py | test_manager.py | py | 9,328 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sentry.features.BatchFeatureHandler",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sentry.features",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "sentry.features",
"line_number": 13,
"usage_type": "name"
},
{
"api_name... |
584215938 | from tkinter import *
from PIL import ImageTk,Image
root=Tk()
root.title("First Window")
def open():
global my_img
top=Toplevel()
my_img=ImageTk.PhotoImage(Image.open("C:/Users/Snehal/Pictures/img3.jpg"))
top.title("Second Window")
my_label=Label(top,image=my_img).pack()
btn=Button(r... | null | newwindow.py | newwindow.py | py | 391 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.ImageTk.PhotoImage",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.ImageTk",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"li... |
23057707 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Iterable
def chain(*iterables):
flat_list = []
for it in iterables:
if isinstance(it, int): # если вдруг просто число
yield it
elif any(isinstance(i, list) for i in it): # если наш лист флаттенед, то его над... | null | lab3/chain.py | chain.py | py | 898 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Iterable",
"line_number": 14,
"usage_type": "argument"
}
] |
16726309 | #!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
sys.path.append('gen')
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
from user_service import UserService
from datatype.ttypes import ThriftResult, ResultInt... | null | demos/thrift_demo/test_server.py | test_server.py | py | 1,181 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "socket.gethostbyname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "socket.gethostname",... |
539918302 | import argparse
import os
import random
import numpy as np
class NGramModel:
def __init__(self, N=2):
'''
length of the gram
smoothing
'''
self.N = N
def generate_features(self, file_path):
'''
commenting
'''
f = open(file_path)
... | null | ngram_model.py | ngram_model.py | py | 4,104 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "ipdb.set_trace",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_number... |
331429029 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0004_event_approve_email_content'),
]
operations = [
migrations.AddField(
model_name='survey',
... | null | festi/survey/migrations/0005_auto_20150323_0235.py | 0005_auto_20150323_0235.py | py | 722 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
318952181 | import os
import shutil
import subprocess
import argparse
import datetime
#
# Set up optional arguments
#
parser = argparse.ArgumentParser()
parser.add_argument("--destination",
default = '../stadic-export',
help="directory to write exported files to")
parser.add_argument("--git... | null | export.py | export.py | py | 6,335 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
532287347 | import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import tensorflow as tf
def get_boxes(data, num_of_boxes):
rect = data[['w', 'h']].values
kmeans = KMeans(n_clusters = num_of_boxes, random_state = 0).fit(rect)
#labels = kmeans.labels_
boxes = km... | null | utils/yolo_utils.py | yolo_utils.py | py | 2,442 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matpl... |
429348765 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
REGISTER:
---------
Caller script. Designed to call all other functions.
'''
import argparse
import logging
import os
import time
from urllib.parse import urlparse
import psycopg2
from hdx.hdx_configuration import Configuration
from hdx.utilities.easy_logging import... | null | src/hdx/freshness/__main__.py | __main__.py | py | 4,154 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "hdx.utilities.easy_logging.setup_logging",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "hdx.utilities.path.script_dir_plus_file",
"line_number": 32,
"usage_type": "ca... |
168355288 | import pyttsx3
import speech_recognition as sr
import datetime
import os
import cv2
import wikipedia
import webbrowser
import pywhatkit as kit
import sys
import pyjokes
import pyautogui
import time
import requests
import instaloader
import PyPDF2
import json
from bs4 import BeautifulSoup
from pywikihow... | null | jarvis/jarvis.py | jarvis.py | py | 8,084 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyttsx3.init",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "requests.ge... |
426382105 | import json
from functools import reduce
from django.contrib.auth import get_user_model
from graphene_django.utils.testing import GraphQLTestCase
from graphql_relay import to_global_id
from greenhouse.models.water_cycle import (
WaterCycle,
WaterCycleComponent,
WaterPump,
WaterValve,
)
from greenhouse.... | null | core/greenhouse/tests/test_graphql_mutations.py | test_graphql_mutations.py | py | 6,304 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "graphene_django.utils.testing.GraphQLTestCase",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "iot.models.SiteEntity.objects.create",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "iot.models.SiteEntity.objects",
"line_number": 28,
"us... |
162159216 | import os
import imageio
import taichi as ti
import numpy as np
import pandas as pd
import seaborn as sns
from yacs.config import CfgNode as CN
import torch
from torch import nn
import torch.nn.functional as F
from plb.algorithms.logger import Logger
from .optim import Optimizer
from ..engine.taichi_env import TaichiE... | null | plb/optimizer/solver_lstm.py | solver_lstm.py | py | 5,264 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.utils.make_cls_config",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "... |
286196236 | import argparse
import logging
from isora import commands
from isora import settings
from isora.tasks import base as tasks
def get_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument('state_names', metavar='state', nargs='*')
parser.add_argument('-j', '--jobs', ty... | null | isora/cli.py | cli.py | py | 1,651 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "isora.commands.list_tasks",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "isora.commands",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
286803280 | import cv2 as cv
# import sys for system calls
import sys
casc_path = sys.argv[1]
face_cascade = cv.CascadeClassifier(casc_path)
video_capture = cv.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
faces = face_cascade.detectMul... | null | video_detector.py | video_detector.py | py | 719 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
... |
413791610 | # from flask import Flask
# import your_module # this will be your file name; minus the `.py`
# app = Flask(__name__)
# @app.route('/test')
# def dynamic_page():
# return "hello"
# if __name__ == '__main__':
# app.run(host='0.0.0.0', port='8000', debug=True)
from flask import Flask, request
impor... | null | app.py | app.py | py | 1,855 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
259458030 | # -*- coding: utf-8 -*-
from trytond.pool import Pool, PoolMeta
from nereid import request, route, render_template
from nereid.contrib.pagination import Pagination
__all__ = ['WebSite']
__metaclass__ = PoolMeta
class WebSite:
__name__ = 'nereid.website'
@classmethod
@route('/search')
def quick_searc... | null | website.py | website.py | py | 928 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "trytond.pool.PoolMeta",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "trytond.pool.Pool",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nereid.request.args.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nereid... |
196333330 | from nltk import word_tokenize
from nltk.corpus import stopwords
from gensim import models, corpora
import re
import time
''' if necessary
from nltk import download
download('wordnet')
'''
def read_brown_corpus():
''' if necessary
from nltk import download
download('brown')
'''
from nltk.corpus i... | null | lda-lsi-gensim.py | lda-lsi-gensim.py | py | 2,190 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.corpus.brown.fileids",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.brown.words",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "n... |
175353745 | from django.urls import path
from . import views
urlpatterns = [
path('getlist/', views.post_list),
path('getcomment/', views.post_comment),
path('view/', views.post_content),
path('write/', views.QuestionWriteView.as_view()),
]
| null | question/urls.py | urls.py | py | 247 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
467727947 | # !/usr/bin/python
# -*- coding: utf-8 -*-
from pysettings import conf
from pyforms.gui.Controls.ControlBase import ControlBase
if conf.PYFORMS_USE_QT5:
from PyQt5.QtWidgets import QTreeView, QAbstractItemView
from PyQt5.QtGui import QStandardItem, QStandardItemModel
else:
from PyQt4.QtGui import QTreeView, QAbs... | null | pyforms/gui/Controls/ControlTreeView.py | ControlTreeView.py | py | 3,359 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pysettings.conf.PYFORMS_USE_QT5",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pysettings.conf",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pyforms.gui.Controls.ControlBase.ControlBase",
"line_number": 16,
"usage_type": "name"... |
60909833 | # -*- coding: utf-8 -*-
# Copyright 2015 www.suishouguan.com
#
# Licensed under the Private License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/samuelbaizg/ssguan/blob/master/LICENSE
#
# Unless ... | null | tests/ignitor/utility/crypt_test.py | crypt_test.py | py | 1,766 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "rsa.newkeys",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "rsa.encrypt",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "rsa.decrypt",
"lin... |
135842707 | import numpy as np
import pandas as pd
from tqdm import tqdm
from multiprocessing import Pool
from functools import partial
from gseapy.algorithm import enrichment_score, gsea_significance
def gsea_signed(values, signatures, midpoint=0, processes=4,
weighted_score_type=0, progressbar=True):
"""
... | null | packages/bio_utils/bio_utils/gsea.py | gsea.py | py | 3,359 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "functools.partial",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "gseapy.algorithm.gse... |
14778938 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
from lxml import etree
from tripod2.items.types import Tripod2ItemManager
from tripod2.index.sitemaps import Sitemap, SitemapIndex
from datetime import date
import logging
logger = loggin... | null | index/management/commands/t2_build_sitemap.py | t2_build_sitemap.py | py | 5,390 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.core.management.base.BaseCommand.option_list",
"line_number": 20,
"usage... |
151251476 | from pyzbar.pyzbar import decode
import requests
from bs4 import BeautifulSoup
import cv2
def get_barcode_string(img):
d = decode(img)
try:
code = d[0].data.decode("utf-8")
return code
except:
return "error"
def clean_jancode(jancode: str):
jancode = jancode.replace("-", "")
ret... | null | image_to_product.py | image_to_product.py | py | 1,184 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyzbar.pyzbar.decode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
... |
231793927 | import backtrader as bt
from datetime import datetime
class BOLLStrat(bt.Strategy):
params = (
("period", 20),
("devfactor", 2),
("size", 20),
("debug", False)
)
def __init__(self):
self.boll = bt.indicators.BollingerBands(period=self.p.period, devfactor=self.... | null | finance/strategy/bollinger.py | bollinger.py | py | 3,860 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "backtrader.Strategy",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "backtrader.indicators.BollingerBands",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "backtrader.indicators",
"line_number": 15,
"usage_type": "attribute"
},
... |
178018986 | import numpy as np
import time
import torch
import torch.nn.functional as F
import torchvision
from torchvision import models
import argparse
from PIL import Image
from utility import *
from network import Network
parser = argparse.ArgumentParser()
parser.add_argument('data_directory')
parser.add_argument('--save_dir'... | null | train.py | train.py | py | 1,959 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "network.Network",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "torch.save",
"line_number": 79,
"usage_type": "call"
}
] |
508019496 | #!/usr/bin/env python
##############################################################################
# Copyright (c) 2016 Huan Li and others
# lihuansse@tongji.edu.cn
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accom... | null | tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py | test_baseresultchecker.py | py | 3,239 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "yardstick.benchmark.scenarios.availability.result_checker.baseresultchecker.ResultCheckerMgr",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "yardstick.benchmark.scenarios... |
63959057 | import bleach
import marshmallow as ma
from mailparser import MailParser
class UiMessageSchema(ma.Schema):
"""Schema to serialize MailParser object."""
to = ma.fields.String()
subject = ma.fields.String()
html = ma.fields.String()
text = ma.fields.String()
clean_text = ma.fields.String()
... | null | smtpdev/web_server/ui_message_schema.py | ui_message_schema.py | py | 1,015 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "marshmallow.Schema",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "marshmallow.fields.String",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "marshmallow.fields",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name":... |
516710039 | import torchvision
import torch
import torch.nn as nn
import numpy as np
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
import time
import cv2 as cv
import os
def showpic(img):
#展示图片,调试的时候用与实现无关
cv.imshow('image',img)
cv.waitKey(0)
cv.destroyAllWindows()
#pl... | null | FCN_classify_and_detection/deal_data.py | deal_data.py | py | 1,106 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imshow",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.destroyAllWindows",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_numb... |
524709486 | import xml.dom.minidom as minidom
import os
import os.path as osp
import cv2
from PIL import Image
import numpy as np
import pickle as cPickle
from lib.networks.netconfig import cfg
import scipy.misc
class Relation_net_classify( ):
def __init__(self, image_set, devkit_path=None):
self.name = 'mini_imagen... | null | lib/datasets/relation_net_data.py | relation_net_data.py | py | 13,258 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
384594296 | import torch
#data
import numpy as np
import re
ff = open("housing.data").readlines()
data = []
for item in ff:
out = re.sub(r"\s{2,}", " ", item).strip()
print(out)
data.append(out.split(" "))
data = np.array(data).astype(np.float)
print(data.shape)
Y = data[:, -1]
X = data[:, 0:-1]
X_train = X[0:496, ..... | null | pytorchOriented/pytorch_code_official/04/cls_reg/demo_reg.py | demo_reg.py | py | 1,779 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 28,
... |
584810461 | """videolib URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... | null | videolib/urls.py | urls.py | py | 1,903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
297980461 | import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__),'libs'))
import kso_site , koslab_site
import morepath
from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.serving import run_simple
import wfront
HOST='127.0.0.1'
PORT=5000
config = morepath.setup()
config.scan(package=kso_site)
config.... | null | run.py | run.py | py | 803 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
115757721 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 10 22:27:55 2019
@author: hankui
"""
#%%
# https://practice.geeksforgeeks.org/problems/find-largest-word-in-dictionary/0
dictionary = ['lr', 'm', 'lrm', 'hcdar', 'wk']
string = 'hcdarlrm'
#%%
n = len(dictionary)
from numpy import zeros
indicato... | null | General/SolvedFirstTime/Dictionary.py | Dictionary.py | py | 925 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "itertools.compress",
"line_number": 49,
"usage_type": "call"
}
] |
417107565 | from flask import Flask, render_template, request, redirect
import pymongo
from datetime import datetime
from DBUtil import GetDBUtil
from bson.objectid import ObjectId
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.db'
class ToDoDaoImpl:
def __init__(self):
getDb = GetDB... | null | app.py | app.py | py | 1,794 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "DBUtil.GetDBUtil",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "flask.request",... |
8750158 | # import the necessary packages
from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from tensorflow.keras import optimizers
from utilities.preprocessing import ImageToArrayPreprocessor
from utilities.preprocessing import... | null | 1DataAugmentation/minivggnet_flowers17_data_aug.py | minivggnet_flowers17_data_aug.py | py | 3,695 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "imutils.paths.list_images",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "imutils.paths",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "os.pa... |
68940609 | import subprocess
from pathlib import Path
from collections import defaultdict
import pandas
accession_meta = pandas.read_csv("data/samples_ena.txt", sep='\t', index_col='secondary_sample_accession')
sample_meta = pandas.read_csv("data/samples_meta.txt", sep='\t', index_col='Accession')
accession_meta = accession_met... | null | birth_microbiome/create_concat_refs.py | create_concat_refs.py | py | 1,558 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
629417472 | import re
import requests
import urllib
import random
WEBSTA_URL = 'http://websta.me/'
class ScheduleError(Exception):
pass
class Schedule(object):
def __init__(self, hashtags_filename, configuration, state):
self._configuration = configuration
self._hashtags = self._get_hashtags_from_file(ha... | null | schedule.py | schedule.py | py | 2,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "random.randint",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "urllib.quote",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_numbe... |
580612519 | import cv2
imgOriginal = cv2.imread('Resources/wick.jpg')
scale_percent=80
width=int(imgOriginal.shape[1]*scale_percent/100)
height=int(imgOriginal.shape[0]*scale_percent/100)
dim=(width,height)
img=cv2.resize(imgOriginal,dim,interpolation=cv2.INTER_AREA)
thresholdVal=0.6
classNames=[] #burda 0.indexdeki coconame... | null | detectPhoto.py | detectPhoto.py | py | 1,514 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.imread",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_AREA",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn_DetectionModel",
... |
53383630 | from django.contrib.auth import get_user_model
from django.urls import reverse_lazy
from clinic.models import Clinic_Date, Clinic_Date_Patients
from rest_framework import serializers
from accounts.api.serializers import UserDisplaySerializer
from patients.api.serializers import PatientVisitSerializer
class Clinic_Da... | null | project/clinic/api/serializers.py | serializers.py | py | 1,568 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "clinic.models.Clinic_Date",
"line_number": 12,
"usage_type": "na... |
563329224 | """
separator
===================================
This Pelican-Markdown plugin place space before titles.
(except the first)
"""
import re
import markdown as md
from markdown.inlinepatterns import Pattern
from markdown.extensions import Extension
from markdown.util import etree
DEFAULT_SEPARATOR = '\n<br>'
SEPARAT... | null | myplugins/separator/separator.py | separator.py | py | 1,051 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "markdown.inlinepatterns.Pattern",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "markdown.util.etree.Element",
"line_number": 35,
"usage_type": "call"
},
{
"api_name":... |
183416233 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | null | src/main/python/nexusproto/serialization.py | serialization.py | py | 1,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "io.BytesIO",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "nexusproto.DataTile_pb2.ShapedArray",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "nexusproto.... |
610876163 | # -*- coding: utf-8 -*-
"""
Created with:PyCharm
@Author: Jcsim
@Date: 2021-4-26 16:51
@Project: XPS_OCR_GUI
@File: xps_ocr_window.py
@Description:
@Python:3.8
"""
from multiprocessing import freeze_support
freeze_support()
import threading
import tkinter as tk
from tkinter import ttk
from time import sleep
from tkinte... | null | xps_ocr_window.py | xps_ocr_window.py | py | 11,455 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.freeze_support",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 133,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "tkinter... |
218975387 | import pandas as pd
import networkx as nx
import json
import os
from src.environment import EnvironmentNetwork
from src.runner import Runner
data_folder = 'measurement/baseline/'
# load parameters
with open('parameters.json') as json_file:
parameters = json.load(json_file)
# load neighbourhood data
with open('... | null | SABCoModel.py | SABCoModel.py | py | 1,473 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number... |
573733103 | from urllib.request import urlopen
from bs4 import BeautifulSoup
#///////////////////////////////////scraping
def scrapeintro():
cat=input('scrape full html?, piece of html?, web crawler? main menu')
if cat=='full'.lower() or cat=='full html'.lower() or cat=='scrape full html'.lower():
scrape()
eli... | null | BASIC/scrape1.py | scrape1.py | py | 953 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
}
] |
627636434 | import pyaudio
import wave
from tqdm import tqdm
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
def record_video(path,seconds):
#创建播放器
p = pyaudio.PyAudio()
#stream开启数据结构为p的数据流(开启线程)
stream = p.open(format=FORMAT,
channels=CHANNELS,
... | null | python/1.语音录制,播放,读取.py | 1.语音录制,播放,读取.py | py | 1,715 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyaudio.paInt16",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pyaudio.PyAudio",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "wave.open",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_n... |
647685275 | from confluent_kafka import Producer
import sys
# 用來接收從Consumer instance發出的error訊息
def error_cb(err):
print('Error: %s' % err)
# 主程式進入點
if __name__ == '__main__':
# 步驟1. 設定要連線到Kafka集群的相關設定
props = {
# Kafka集群在那裡?
'bootstrap.servers': 'kafka:29092', # <-- 置換成要連接的Kafka集群
'e... | null | practice/kafka_welcome_producer.py | kafka_welcome_producer.py | py | 1,529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "confluent_kafka.Producer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 31,
"usage_type": "attribute"
}
] |
437650424 | import numpy as np
import gym
from gym import wrappers
from gym.envs.registration import register
import matplotlib.pylab as plt
evaluate_v = []
def run_episode(env, policy, gamma = 1.0, render = False):
""" Runs an episode and return the total reward """
obs = env.reset()
total_reward = 0
step_idx = ... | null | MDP/frozenlake_policy_iteration_.py | frozenlake_policy_iteration_.py | py | 2,853 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.mean",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": ... |
78791179 | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, get_object_or_404
from .forms import *
from .models import *
from django.contrib.auth.decorators import login_required
##### _new -> Cria um novo #####
##### _detail -> Mostra mais sobre #####
... | null | pgen/templates/views.py | views.py | py | 5,713 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 18,
"usage_type": "name"... |
310047164 | from functools import partial
from ..fields import DjangoConnectionField
from .utils import get_filtering_args_from_filterset, get_filterset_class
class DjangoFilterConnectionField(DjangoConnectionField):
def __init__(self, type, fields=None, order_by=None,
extra_filter_meta=None, filterset_clas... | null | graphene-django/graphene_django/filter/fields.py | fields.py | py | 1,800 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fields.DjangoConnectionField",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.get_filterset_class",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utils.get_filtering_args_from_filterset",
"line_number": 20,
"usage_type": "call"
... |
652468619 | from operator import add
from itertools import chain
from toolz import keyfilter
from .compatibility import builtins
def inc(x):
return x + 1
def ishashable(x):
""" Is x hashable?
Example
-------
>>> ishashable(1)
True
>>> ishashable([1])
False
"""
try:
hash(x)
... | null | dask/core.py | core.py | py | 4,738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "compatibility.builtins.set.union",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "compatibility.builtins.set",
"line_number": 127,
"usage_type": "attribute"
},
{
"api_name": "compatibility.builtins",
"line_number": 127,
"usage_type": "name"
},... |
401908526 | from djet import assertions
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from .common import create_user
class UserViewSetListTest(APITestCase, assertions.StatusCodeAssertionsMixin):
def setUp(self):
self.user = create_user(usern... | null | testproject/testapp/tests/test_user_detail.py | test_user_detail.py | py | 1,465 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "djet.assertions.StatusCodeAssertionsMixin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "djet.assertions",
"line_number": 9,
"usage_type": "name"
}... |
85696841 | import jsonpickle
import six
class EventSerializer:
IGNORE_ATTRS = frozenset(['key', 'custom', 'anonymous'])
ALLOWED_TOP_LEVEL_ATTRS = frozenset(['key', 'secondary', 'ip', 'country', 'email',
'firstName', 'lastName', 'avatar', 'name', 'anonymous', 'custom'])
def __init__(self, config):
se... | null | ldclient/event_serializer.py | event_serializer.py | py | 2,097 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jsonpickle.encode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "six.iteritems",
"line_number": 48,
"usage_type": "call"
}
] |
37139102 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 11:56:12 2019
Result Analysis of the Single Pendulum Optimization.
@author: huawei
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import os
St = 0
Ed = 10
num_nodes = 5001
interval = 0.02
duration = (num_nodes... | null | Chapter5/Experimental Study/ResultAnalysis_FPDTD_GenerateBestGainsForEachParticipant.py | ResultAnalysis_FPDTD_GenerateBestGainsForEachParticipant.py | py | 8,332 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.exists",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_num... |
525319289 | #!/usr/bin/env python
import argparse
import codegen
import sys
import os
import directories
import jobs
if __name__ == "__main__":
parser=argparse.ArgumentParser(description='Converts XML files into executable')
parser.add_argument('--r', help = 'Remove executable (for a packaged directory the --d option ... | null | python/miind.py | miind.py | py | 1,430 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "directories.add_executable",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "jobs.write_out_job",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": ... |
177505798 | from multiprocessing import cpu_count
from os import environ
bind = '0.0.0.0:{port}'.format(port=environ.get('PORT', '8000'))
max_requests = 1000
worker_class = 'gevent'
workers = cpu_count()
env = {
'DJANGO_SETTINGS_MODULE': 'app.settings'
}
reload = True
name = 'app'
| null | app/gunicorn.py | gunicorn.py | py | 278 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "multiprocessing.cpu_count",
"line_number": 8,
"usage_type": "call"
}
] |
140814213 | from django.db import models
from django.conf import settings
import os, copy
from cropduster import utils
from PIL import Image as pil
from south.modelsinspector import add_introspection_rules
from django.core.exceptions import ValidationError
CROPDUSTER_UPLOAD_PATH = getattr(settings, "CROPDUSTER_UPLOAD_PATH", sett... | null | cropduster/models.py | models.py | py | 12,512 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.conf.settings",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "django.conf.settings.MEDIA_ROOT",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.Manager",
"line_number": 31,
"usage_type": "attribute"
}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.