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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
194137955 | import os
from utils import plot_util as pu
LOG_ROOT = 'logs/'
PLOT_ROOT = 'plots/'
def plot_dir(log_dir, env_name, evalflag=False):
if not evalflag and 'eval' in env_name:
return
if not os.path.exists(PLOT_ROOT + env_name):
os.mkdir(PLOT_ROOT + env_name)
results = pu.load_results(log... | null | saveplot.py | saveplot.py | py | 585 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.plot_util.load_results",
... |
132396984 | # wpt-submissions.live is a public deployment of WPT, maintained in an external
# repository. It automatically fetches and deploys all refs in the WPT
# repository which match a certain pattern. This behavior is intended to be
# used for pull requests so that reviewers can preview changes without running
# the WPT serv... | null | third_party/blink/web_tests/external/wpt/tools/ci/update_pr_preview.py | update_pr_preview.py | py | 8,380 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.environ.ge... |
126140564 | from django.shortcuts import render
from django.shortcuts import HttpResponse,HttpResponseRedirect
from testapp.templates import *
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from testapp.models.module import Module
from testapp.forms import ModuleForm
# Create your views h... | null | testapp/views/module_views.py | module_views.py | py | 2,155 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "testapp.models.module.Module.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "testapp.models.module.Module.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "testapp.models.module.Module",
"line_number": 13,
"usa... |
354138087 | import asyncio
import logging
import threading
import discord
import imgurpython
import yaml
from sazabi.model import Channel
from sazabi.plugins.twitch import Twitch
from sazabi.types import SazabiBotPlugin, LoggedObject
client = discord.Client()
class Sazabi(LoggedObject):
def __init__(self, session, config='c... | null | sazabi/__init__.py | __init__.py | py | 3,062 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sazabi.types.LoggedObject",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "logging.INFO",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "yaml.load"... |
31266638 | '''Train CIFAR10 with PyTorch.'''
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
import os
import argparse
import re
from tensorboardX import SummaryWriter
import json
... | null | main.py | main.py | py | 9,915 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "re.findall",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numbe... |
506475927 | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 15:23:17 2015
Funkcije koriscenje za kolokvijum iz predmeta Soft Kompjuting 2015/16 (Uz neke izmene)
@author: aloha
"""
#%% IMPORT ALL LIBRARIES
#import potrebnih biblioteka za K-means algoritam
# %matplotlib inline
import numpy as np
import matplotlib.pyplot as p... | null | softFunctions.py | softFunctions.py | py | 18,517 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pylab",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "cv2.cvtColor",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "cv2.imre... |
201919668 | import warnings
import numpy as np
from scipy.sparse import csr_matrix, coo_matrix, tril
from scipy.sparse.linalg import cg
from scipy.sparse.linalg import spsolve
from concurrent import futures
from rwtools.graphtools.numba_cg import ichol_csc, csc2csr, _cg, _cg_ichol_preconditioned
import multiprocessing
try:
... | null | rwtools/graphtools/solvers.py | solvers.py | py | 8,615 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.warn",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.linalg.spsolve... |
374254461 | #!usr/bin/env python3
import sys
sys.path.append('/usr/local/lib/python3.5/dist-packages')
import serial
HEAD = b'\xAA\xAA'
END = b'\xEF'
RF433_CMD = 0x01
class ZQGateway:
def __init__(self,port,baude):
self.ser=serial.Serial(port,baude)
def write_rf433(self,data,timers=4):
cmd = (timers<<4)|RF433_CMD #INT
... | null | PyLib/gateway/gateway.py | gateway.py | py | 697 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_number": 13,
"usage_type": "call"
}
] |
367677237 | import requests
import sqlite3
connection=sqlite3.connect('previous')
cursor=connection.cursor()
import time
import subprocess
import os
import signal
from discord_hooks import Webhook
from html.parser import HTMLParser
parser = HTMLParser()
url="https://discordapp.com/api/webhooks/487006022729334814/_y9zHMUlUP4eOLBHDr... | null | main.py | main.py | py | 1,789 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "html.parser.HTMLParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"... |
320336658 | import sys
import time
from selenium import webdriver
votes = 0
driver = webdriver.Chrome()
driver.get('https://biletnikoffaward.com/fan-vote')
while True:
#driver = webdriver.Chrome()
if driver.find_element_by_id('PDI_answer48276570'):
button = driver.find_element_by_id('PDI_answer48276570')
... | null | jj_click.py | jj_click.py | py | 610 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
}
] |
373762374 | from models.states.stateName import StateName
import random
from datetime import date
from utils import utils
class Model:
def __init__(self):
self.states = {
StateName.chapter: [],
StateName.sub_chapter: [],
StateName.section: [],
StateName.sub_section: []... | null | models/model.py | model.py | py | 4,488 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.states.stateName.StateName.chapter",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.states.stateName.StateName",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.states.stateName.StateName.sub_chapter",
"line_number... |
449675651 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
try:
import gym
from gym import spaces
except ImportError:
gym = None
import numpy as np
import reinforceflow
from reinforceflow.envs.env_wrapper import EnvWrapper
from reinforceflow.uti... | null | reinforceflow/envs/gym_wrapper.py | gym_wrapper.py | py | 5,603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "reinforceflow.envs.env_wrapper.EnvWrapper",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "six.string_types",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "gym.make",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
264694080 | # -*- coding: utf-8 -*-
""" REST API client library for python """
import sys, re, requests
from nweb.util import DObj, json_loads, json_dumps
if sys.version_info >= (3,0):
from urllib.parse import urljoin
else:
from urlparse import urljoin
#==========================================================... | null | util/client.py | client.py | py | 10,207 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "urlparse.urljoin",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "requests.put",
... |
518298387 | """
Six covariance shrinkage estimators, as presented in Shafer & Strimmer,
"A shrinkage approach to large-scale covariance matrix estimation and
implications for Functional Genomics." //Statistical Applications in
Genetics and Molecular Biology//, vol 4(2005), issue 1.
"""
import itertools
import numpy as np
def _w... | null | funcsim/shrinkage.py | shrinkage.py | py | 7,635 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.cov",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.cov",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.identity",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "itertools.product",
"line_numb... |
554820663 | from django.conf.urls import url
from . import views
app_name = 'theorems'
urlpatterns = [
url(r'^$',views.index,name='index'),
# subjects
url(r'^subjects/$', views.subjects, name='subjects'),
url(r'^subjects/(?P<subject_id>[1-9]*([0-9]+))/theorems/$',views.subject_theorems, name='subject_theorems'),
... | null | theorems/urls.py | urls.py | py | 847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.c... |
365865258 | import logging
import config
import os
logging.basicConfig(level = config.log_level,
format = config.log_format,
datafmt = config.log_date,
file = os.path.join(config.work_dir, config.log_file),
filemode = config.log_file_mode)
def log_error(str):
logging.error(str)
def log_info(str):
logging.i... | null | log.py | log.py | py | 329 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.log_level",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "config.log_format",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "config.... |
367316602 | import unittest
import HtmlTestRunner
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from PageObjects.Register impo... | null | TestCases/Register/test_case_06.py | test_case_06.py | py | 1,749 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriv... |
636341813 | # -*- coding: utf-8 -*-
import __builtin__
import pytest
import yaml
from domoticz_utils.presence.detector import InvalidConfigFileError, PresenceDetectorConfig, DeviceConfig
@pytest.fixture
def config():
return {
'finders': {
'ip_finder': {
'class': 'IpFinder'
}
... | null | tests/presence/test_presence_detector_config.py | test_presence_detector_config.py | py | 1,323 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "domoticz_utils.presence.detector.PresenceDetectorConfig",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "domoticz_utils.presence.detector.PresenceDetectorConfig",
"lin... |
298284705 | from django.conf.urls import url, include
from apps.sales.views import *
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'sales/viewsEvent.html', login_required(listEvent), name='evento_listar_compras' ),
url(r'sales/myShops.html', login_required(listShops), name='listar_... | null | sporticket/apps/sales/urls.py | urls.py | py | 1,205 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
... |
293559420 | # -*- coding: utf-8 -*-
import tensorflow as tf
from yolo_v3 import darknet
from yolo_v3_tiny import yolo_v3_tiny
import logging
import time
from utils import load_coco_names, load_weights
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string(
'weights_file', '', 'Binary file with detector weights')
tf.app.flag... | null | darknet2tf/convert_weights.py | convert_weights.py | py | 2,272 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.app",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.app.flags.DEFINE_string",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.app",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_na... |
496954664 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2022/12/8 15:34
# @Author : ZANWEB
# @File : ExtWidget in PyCharm
# @IDE : PyCharm
# @Function :
import sys
# from PyQt5 import QtCore
from PyQt5.QtWidgets import QComboBox, QApplication, QTableWidget, QTableWidgetItem, QCompleter
from PyQt5.Q... | null | QtExt/ExtWidget.py | ExtWidget.py | py | 5,368 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtCore.QAbstractItemModel",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCore.QModelIndex",
"line_number": 18,
"usage_type": "call"
},
{
"... |
458899165 | import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch
import preprocessing
from sklearn.model_selection import train_test_split
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import torch.utils.data
from torch.uti... | null | train.py | train.py | py | 2,080 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "preprocessing.sent_token",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "preprocessing.aricle",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.text.Tokenizer",
"line_number": 25,
"usage_type": "call"
},
{
"... |
26708183 | import time
import requests
import pandas as pd
def get_cryptopia_json():
url_curr = 'https://www.cryptopia.co.nz/api/GetCurrencies'
resp = requests.get(url_curr)
json = resp.json()
return json
def main():
while True:
datas = get_cryptopia_json()
df_columns = ['Id', 'Name', 'Symb... | null | main.py | main.py | py | 820 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 28,
"usage_type": "call"
}
] |
603939115 | from django.http import HttpResponse, Http404
from datetime import datetime
from django.template import Context, Template
from django.template.loader import get_template
from django.shortcuts import render_to_response
from books.models import Publisher
import urllib2
import logging
iplog_fpath = ""
html_header = "<ht... | null | outport/viewstest.py | viewstest.py | py | 3,495 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.debug",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "django.http.Htt... |
609911611 | import os,sys
import pylab
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
# setup font
font = {'family' : 'sans-serif',
'color' : 'black',
'weight' : 'normal',
'size' : 16,
}
# step size (constant value)
DT = 0.001
# load data
y = pylab.loa... | null | inverse_dynamics/plot_PD_hold_torques.py | plot_PD_hold_torques.py | py | 929 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pylab.loadtxt",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
632135924 | #!/usr/bin/env python3
import paramiko
import scp
import sys
local = sys.argv[1]
client = paramiko.client.SSHClient()
pemkey = paramiko.RSAKey.from_private_key_file("/var/opt/4521/deploy/4521.pem")
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect("52.15.130.... | null | deploy/ssh_scp.py | ssh_scp.py | py | 542 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "paramiko.client.SSHClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "paramiko.client",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "paramiko.RS... |
171016734 | import pandas as pd
import altair as alt
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split, cross_validate
# Loading in the data
pokemon_df = pd.read_csv('data/pokemon.csv')
# Define X and y
X = pokemon_df.drop(columns = ['deck_no', 'name','total_bs', 'type', 'leg... | null | exercises/en/solution_04_20a.py | solution_04_20a.py | py | 1,809 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sklearn.neighbors.KNeighborsClassifier",
"line_number": 21,
"usage_type": "call"
... |
307194245 | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="ogtool",
version="0.5.2",
packages=find_packages(exclude='tests'),
install_requires=['appscript', 'pyobjc', 'polib', 'pyyaml'],
author="Bernh... | null | setup.py | setup.py | py | 1,519 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
336138727 | from collections import Counter
MIN_THRESHOLD=5
def preprocess(file_name):
counter=Counter()
with open(file_name,"r") as f:
for line in f.readlines():
counter.update(line.strip().split(" "))
#print(dict(counter))
for k,v in dict(counter).items():
if int(v)<MIN_THRESHOLD:
... | null | NLP/word2vec/word_count.py | word_count.py | py | 690 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 5,
"usage_type": "call"
}
] |
176961812 | from __future__ import print_function, unicode_literals, division
import numpy as np
import ROOT
import scipy.constants as con
###################### Ende Header
N=1 #Normierungskonstante
m=2*con.u #Masse H2 molekül
T=200 # bei 200Kelvin
def f(v): #verteilungsfunktion
return N*(m/(2*np.pi*con.k*T))**(3/2)*np.e**... | null | Übungen/Blatt2/Aufgabe1.py | Aufgabe1.py | py | 575 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.constants.u",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.pi",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants.k"... |
405467212 | from setuptools import setup, find_packages
# declare these here since we use them in multiple places
_tests_require = [
'pytest',
'pytest-cov',
'flake8',
]
setup(
# package info
name='projectDani',
description='Provee una interfaz al usuario para que autogenere reportes de transacciones',
... | null | setup.py | setup.py | py | 1,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 19,
"usage_type": "call"
}
] |
645631994 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 5 14:23:41 2016
@author: Stephan
"""
import numpy as np
import matplotlib.pyplot as plt
location = "D:\\bachelorproject\\image july\\"
doList=[0,40,80,120,160]
color=['b','g','r','c','m','y','k']*10
plt.figure()
colorID=0
for item in doList:
... | null | code/overig-2/structure factor mean stack.py | structure factor mean stack.py | py | 3,038 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.fft.fft2"... |
451997275 | ''' Contains configuration code '''
from __future__ import unicode_literals
import sqlite3
import logging
# Authors
def list_authors(self):
''' Create a list of all authors known in the database '''
cursor = self.db_con.cursor()
cursor.execute('SELECT id,name FROM authors')
return cursor.fetchall()
d... | null | messageconnoisseur/configuration.py | configuration.py | py | 3,214 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.info",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "sqlite3.IntegrityError",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "logging.info",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sqlite3.Integri... |
19899666 | #!/usr/bin/env python
# coding: utf-8
import re
import markdown2
from flask import Flask
from pygments import highlight
# noinspection PyUnresolvedReferences
from pygments.formatters import HtmlFormatter
from pygments.lexers import (get_lexer_by_name,
get_lexer_for_filename,
... | null | python/src/application.py | application.py | py | 3,243 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "markdown2.MarkdownWithExtras",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "flask.send_from_d... |
481230336 | from django.conf import settings
from django.contrib.auth import login, get_user_model
class AuthenticationMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
if not request.user.is_authenticated():
model = get_user_... | null | scoreboard/challenges/middleware.py | middleware.py | py | 479 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.login",
"line_number": 14,
"usage_type": "call"
}
] |
66024242 | '''
The "glue" that connects algorithms to
datasets.
'''
import matplotlib.pyplot as plt
import numpy as np
class Testbed:
def __init__ (self, ds, alg, loss, T=None):
# ds is a Dataset object.
# alg is an Algorithm class.
self.dataset = ds
self.algorithm = alg
self.horizon = T
self.loss = loss
if T is ... | null | fabian/testbed.py | testbed.py | py | 4,266 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "mat... |
148958446 | """
run seq to seq model, use original metric 4 as score
"""
import torch
import pandas as pd
import shapely
import numpy as np
import sys
import torch
import argparse
import random
import math
import os
from sklearn.preprocessing import OneHotEncoder
from scipy.stats import stats
from torch.utils.data import DataLoad... | null | code/build_model/TS_rnn1.py | TS_rnn1.py | py | 9,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.L1Loss",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.optim.Adam",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"lin... |
565525734 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('docs/readme.rst') as readme_file:
readme = readme_file.read()
with open('docs/history.rst') as history_file:
history = history_file.read()
setup_requires = ['pytest-runner']
requirements = [
'requests',
'six',
]
... | null | setup.py | setup.py | py | 1,454 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 24,
"usage_type": "call"
}
] |
108643781 | # -*- coding: utf-8 -*-
import mimetypes
import mysmtplib
import theater_info
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
def sendGmail(bookmark):
#global value
host = "smtp.gmail.com" # Gmail STMP 서버 주소.
port = "587"
htmlFileName = "logo.html"
senderAddr = "dpldp92@gmail... | null | final_project/gmail.py | gmail.py | py | 2,072 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "email.mime.base.MIMEBase",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "theater_info.GetMovieInfo",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 32,
"usage_type": "call"
},
{
"api_n... |
279621658 | import requests
import lxml.html
def download(url,num_retries=2):
print('downloading:',url)
#html=urllib.request.urlopen(url).read()
html=requests.get(url)
html.encoding='utf-8'
#print(html)
return html.text
html = download('http://example.webscraping.com/view/Anguilla-8')
tree = lxml.html.fromstring(html)
... | null | Web Scraping/charpter02/2.2.3_lxml.py | 2.2.3_lxml.py | py | 401 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "lxml.html.html.fromstring",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "lxml.html",... |
467853748 | import argparse
import logging
import os
import scipy.misc
import numpy as np
import torch
from PIL import Image
from torchvision import transforms
from model import FCN8s
import matplotlib.pyplot as plt
from torch.autograd import Variable
from collections import OrderedDict
from torch.utils.data import DataLoader
from... | null | fcn/video.py | video.py | py | 3,194 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PIL.Image.fromarray",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.uint8",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"l... |
241138589 | import os
import json
import pytest
import tempfile
from pathlib import Path
from jina.hubble import helper
@pytest.fixture
def dummy_zip_file():
return Path(__file__).parent / 'dummy_executor.zip'
def test_parse_hub_uri():
result = helper.parse_hub_uri('jinahub://hello')
assert result == ('jinahub', '... | null | tests/unit/hubble/test_helper.py | test_helper.py | py | 1,250 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "jina.hubble.helper.parse_hub_uri",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "jin... |
652919896 |
# coding: utf-8
#%%
import numpy as np
import pandas as pd
import re
from datetime import datetime
np.set_printoptions(threshold=100000)
pd.options.display.max_rows = 500
pd.options.display.max_columns = 100
pd.set_option('expand_frame_repr', False)
#%% 定义字典
dict_peitao = [
{'col': '配套用房_总', 'p': ['配套商业及行政办公', ... | null | policy/building.py | building.py | py | 21,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.options",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pandas.options",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pandas... |
210778746 | # API for houses data
import psycopg2 as pgp2
from possibilities import *
# Opens db connection and sets cursor
def open_conn():
# set up connection
conn = pgp2.connect(
database="postgres",
user="postgres",
password="supersecret",
host="localhost",
port="5432"
)
... | null | code/api.py | api.py | py | 1,818 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 8,
"usage_type": "call"
}
] |
148873155 | import PySimpleGUIQt as sg
import os.path
import cv2
sg.theme("DarkBlue17")
file_list_column = [
[
sg.Text("Image Folder"),
sg.In(size=(25, 1), enable_events=True, key="-FOLDER-"),
sg.FolderBrowse()
],
[
sg.Listbox(
values=[], enable_events=True, s... | null | Draft 2 - Internal Presentation/image_viewer.py | image_viewer.py | py | 2,417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PySimpleGUIQt.theme",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "PySimpleGUIQt.Text",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PySimpleGUIQt.In",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PySimpleGUIQt.F... |
245359687 | # uncompyle6 version 3.6.7
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: /Users/Ari/src/callisto-core/callisto_core/wizard_builder/migrations/0005_delete_constraints.py
# Compiled at: 2019-08-07 16:42:06
# Size... | null | pycfiles/calllib-1.8-py2.py3-none-any/0005_delete_constraints.cpython-36.py | 0005_delete_constraints.cpython-36.py | py | 1,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 15,
"usage_type": "call"
},
... |
37512052 | #********************************************
# Name: game.py
# Author: Mark Tuddenham
# Last Modified: 19/12/2013
# Description: The Main File for Arch Mage: Blood Of The Magi,
# inculdes the rendering, reading in settings file and game logic
#****************************************... | null | src/client/game.py | game.py | py | 4,963 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
574220145 | # -*- coding: utf-8 -*-
import argparse, json, pylab, sys, math, re, os.path
kPsecPerAu = 2.418884326505e-5 # Time
def print_energy(ts, xs, filename):
with open(filename, 'w') as fp:
fp.write('# time[ps]\tenergy[au]\n')
for t, x in zip(ts, xs):
fp.write('%f\t%f\n' % (t, x))
def read_... | null | visualizer3/plot_energy.py | plot_energy.py | py | 5,836 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.search",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pylab.xlabel",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "pylab.xlabel",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "pylab.xlim",
"line_number": 6... |
147026669 | from django.conf.urls import url, include
from django.contrib import admin
from classifier import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^tokenization/$', views.tokenization, name='tokenization'),
url(r'^stopword_removal/$', views.stopword_removal, name='stopword_removal'),
... | null | classifier/urls.py | urls.py | py | 676 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "classifier.views.index",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "classifier.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django... |
157890922 | from django.shortcuts import render
from django.http import HttpResponse
from rest_framework.decorators import api_view
from rest_framework.response import Response
from onlineapp.models import College,Student,MockTest1
from onlineapp.serializers import CollegeSerializer,StudentSerializer
from rest_framework import sta... | null | AppsTrack/classproject/onlineapp/views/college_list.py | college_list.py | py | 2,057 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "onlineapp.models.College.objects.all",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "onlineapp.models.College.objects",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "onlineapp.models.College",
"line_number": 18,
"usage_type": "n... |
527107336 | import json
import logging
import os
from io import BytesIO
import boto3
import configargparse
import torch
import torch.nn as nn
import torchvision.models as models
from PIL import Image
from torch.nn import functional as F
from torchvision.transforms import transforms
CONFIG_FILENAME = 'configs/eccv_final_model'
CH... | null | src/sm_entrypoint.py | sm_entrypoint.py | py | 15,565 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torchvision.transforms.transforms.Compose",
"line_number": 25,
"usage_type": "call"
},
{
"ap... |
183783598 | import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
from .clust_color import assign_clustered_colors
def parameters(result, ax=None, free_indices_only=True, lb=None, ub=None):
"""
Plot parameter values.
Parameters
----------
result: pypesto.Result
... | null | pypesto/visualize/parameters.py | parameters.py | py | 3,164 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 90,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "numpy.array"... |
195167547 | import logging
import traceback
import MySQLdb
import re
import sqlparse
from . import EngineBase
from .models import ResultSet, ReviewResult, ReviewSet
from .inception import InceptionEngine
from sql.utils.data_masking import Masking
from common.config import SysConfig
logger = logging.getLogger('default')
class M... | null | sql/engines/mysql.py | mysql.py | py | 12,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sql.utils.data_masking",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "sql.utils.da... |
173093468 |
import pygame
from pygame.sprite import Group
from game_xh.button import Button
from game_xh.game_stats import GameStats
from game_xh.scoreboard import Scoreboard
from game_xh.settings import Setting
from game_xh import game_function as gf
from game_xh.ship import Ship
def run_game():
pygame.init()
ai_sett... | null | game_xh/alien_invasion.py | alien_invasion.py | py | 1,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "game_xh.settings.Setting",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.d... |
257605753 | import base64
import logging
import struct
import threading
from tornado import gen
from tornado.iostream import StreamClosedError
from tornado.tcpserver import TCPServer
from gateway import net
from gateway.camera.device import CameraDevice
logger = logging.getLogger(__name__)
class CameraTCPServer(TCPServer):
... | null | gateway/camera/tcp.py | tcp.py | py | 2,530 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tornado.tcpserver.TCPServer",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "threading.Lock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "struct.u... |
546927364 | import csv
from datetime import date
date = date.today()
queryFile = '/home/kirankumar/Shared/Common Files/used_queries.csv'
readFile = open(queryFile, 'r')
printHeader = True
length = len(readFile.readlines())
print("Total lines in file is {}".format(length))
if length >= 1:
writeFile = open(queryFile, "a")
w... | null | src/QueriesSaver.py | QueriesSaver.py | py | 692 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.date.today",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"l... |
210814648 | from keras.applications.vgg19 import VGG19
from keras.applications.vgg19 import preprocess_input
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.callbacks import TensorBoard
from keras.layers import Dense, GlobalAveragePooling2D
from keras.optimizers import SGD
from ut... | null | keras_naked_VGG19.py | keras_naked_VGG19.py | py | 4,101 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.curdir",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_num... |
449510287 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
... | null | students/migrations/0001_initial.py | 0001_initial.py | py | 3,141 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.CreateModel",
"line_number": 16,
"usage_type": "call"
},
... |
136146030 | # 受迫振动的图像
import numpy as np
import matplotlib.pyplot as plt
import math
k = 5 # 简谐系统劲度系数
m = 0.45 # 有效质量
b = 0.1 # 阻尼系数
A = [0.1, 0.2, 0.3, 0.4] # 振幅
alpha = b/(2*m)
beta = math.sqrt(k/m-b**2/(4*m))
t = np.arange(0, 10 ,0.01)
x = []
for i in range(0, 4):
x.append(A[i]*np.exp(-alpha*t)*(np.cos(beta*t)+(alpha/... | null | code/Ex10_1_2.py | Ex10_1_2.py | py | 541 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.sqrt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 18,
... |
114514744 | import datetime
from django.test import TestCase
from django.utils import timezone
from app.models import Post, Syntax
class PostModelTest(TestCase):
@staticmethod
def validate_time_to_live(date_time):
now_plus_10_min = timezone.now() + \
datetime.timedelta(minutes=10)
if date_time <= now_plus_10_... | null | src/app/tests/tests_models.py | tests_models.py | py | 1,725 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "d... |
251043845 | import json
import os
import sys
import traceback
from asyncio import sleep
from os import listdir
from os.path import isfile, join
import discord
from discord.ext import commands
class KnastBot(commands.Bot):
config_path = ''
config = {}
users = {}
def __init__(self, config_path, config, users, com... | null | knastbot.py | knastbot.py | py | 3,040 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "discord.Game",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "disco... |
468414233 | # 1. 向上跳空不缺口?
import pandas as pd
import numpy as np
from datetime import timedelta
csv_file = '../stock_info/111.csv'
df = pd.DataFrame.from_csv(csv_file)
print(df.columns.values)
row_num = df.index.size
dict = {}
df_out = pd.DataFrame(columns=['日期', '间隔天数', '跳空比例', '索引'])
df['日期'] = pd.to_datetime(df['日期'])
... | null | test/strategy/strategy_tiaokong.py | strategy_tiaokong.py | py | 1,749 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame.from_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas... |
239362782 | # python3.6
# Created: 09-25-2018
import collections
class Solution:
def lengthOfLongestSubstring(self, s):
"""
:type s: str
:rtype: int
"""
def checkRepeat(s):
# Helper function
countDict = collections.Counter(s)
'''
A Counte... | null | leet-code/medium/3_longest_substring_without_repeating_characters.py | 3_longest_substring_without_repeating_characters.py | py | 1,898 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 14,
"usage_type": "call"
}
] |
417359685 | import os
import sys
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# create_session_cookie
from django.conf import settings
from django.contrib.auth import (
SESSION_KEY, BACKEND_SESSION_KEY, HASH_SESSION_KEY,
get_us... | null | multichat/functional_tests/base.py | base.py | py | 7,980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
348918609 | from pyramid.config import Configurator
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from .security import EntryFactory
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configur... | null | build/lib/learning_journal/__init__.py | __init__.py | py | 860 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyramid.config.Configurator",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pyramid.authentication.AuthTktAuthenticationPolicy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyramid.authorization.ACLAuthorizationPolicy",
"line_number": 1... |
182811535 | #encryption
from requests import get
ip = get('https://api.ipify.org').text
ipList = ip.split('.')
with open("DataAnalysis.txt",'w') as fp:
for count, c in enumerate(ipList):
c = str(int(int(c) + 345678) * (count + 2)) + "\n"
fp.write(c) | null | DataAnalysisW.py | DataAnalysisW.py | py | 269 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 4,
"usage_type": "call"
}
] |
336414349 | import socketio
import argparse
import numpy as np
from PIL import Image
from io import BytesIO
import base64
import time
import cv2
import os
import datetime
import time
import json
PORT = 8000
HOST = "34.91.63.13"
NAME_SPACE = "/asset"
MESSAGE_FROM_CLIENT = "book_rec"
MESSAGE_TO_CLIENT = "book_rec_results"
SERVR = ... | null | client.py | client.py | py | 1,552 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imencode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_nu... |
433091749 | # encoding: UTF-8
import logging
from client.websocketClient import websocketClient
BINANCE_HOST = 'wss://stream.binance.com:9443'
class binanceWebsocket(websocketClient):
""""""
MAX_TABLE_LEN = 100
#----------------------------------------------------------------------
def __init__(self):
... | null | api/binanceWebsocket.py | binanceWebsocket.py | py | 2,658 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "client.websocketClient.websocketClient",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "logging.info",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "loggi... |
220171344 | # -*- coding: utf-8 -*-
from pymongo import MongoClient
moclient = MongoClient()
#moclient = MongoClient ('192.168.7.16', 27017)
moclient = MongoClient('localhost', 27017)
db = moclient.zhihu_xiaomi
db.collection_names(include_system_collections=False)
coll = db.comments_copy
tmp_coll = db.cid_dups
for i in tmp_coll... | null | zhihu_xiaomi/build/lib/zhihu_xiaomi/distinct.py | distinct.py | py | 618 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
}
] |
378426426 | import datetime
import json
from django.core.mail import EmailMultiAlternatives
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.shortcuts import redirect
from .models import User, ConfirmString
from . import forms
from django.conf import settings
import hashlib
from dj... | null | login_django/login/views.py | views.py | py | 6,826 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "geetest.GeetestLib",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "... |
111197613 | import pymssql
"""
目的:自动计算工资
版本:v1
备注:废弃,采用java编写
"""
# 查
def ExecQuery(sql):
conn=pymssql.connect(host='10.10.21.253',user='sa',password='password',database='ecology')
cursor=conn.cursor()
cursor.execute(sql)
ls=cursor.fetchall()
cursor.close()
conn.close()
return ls
# 增 ... | null | HistoricalVersion/CountSalary.py | CountSalary.py | py | 2,205 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pymssql.connect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pymssql.connect",
"line_number": 20,
"usage_type": "call"
}
] |
487549070 | #!/usr/bin/env python3
# coding: utf-8
import time
import wxpy
import logging
import re
import html
from . import config
from .slackbot_main import slackbot
slack_client = slackbot._client
wxbot = None
emoji_map_table = {
'[Smile]': u'\U0001f600',
'[Drool]': u'\U0001f60d',
'[Scowl]': u'\U0001f633',
'... | null | wxslack/wxbot_slack.py | wxbot_slack.py | py | 4,807 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "slackbot_main.slackbot._client",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "slackbot_main.slackbot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "... |
368435117 | import argparse
parser = argparse.ArgumentParser(description='add the category text to get the data ready')
parser.add_argument("-i", "--input_file", dest='input_file', default="test.tsv", required=True,type=str, help="input txt file")
parser.add_argument("-o", "--output_file", dest='output_file', default="text_out.ts... | null | ag_news/data_preprocessing/data_add_categories.py | data_add_categories.py | py | 1,063 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 3,
"usage_type": "call"
}
] |
457847301 | import numpy as np
import cv2
from src.rectangle import rectangle
import csv
class formData():
def __init__(self, image_path, csv_path):
self.image = np.array(cv2.imread(image_path, 1))
self.imageScale = 1000/np.shape(self.image)[1]
self.image = cv2.resize(self.image, (1000, int(self.imageScale*np.shape(self.i... | null | src/formData.py | formData.py | py | 727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 11,
... |
210702880 | import train
import test
from os.path import join
import json
# ------ TRAIN ------
args_train = train.Arguments(net='AlexNet', hash_bit=48, dual_batch=False, scale_tanh=False, tanh_step=200,
#snapshot=("cross-entropy", '2018_12_25_4_19_4', 'iter_07500'),
pre... | null | kerfuffle!.py | kerfuffle!.py | py | 2,206 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "train.Arguments",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "train.produce_config",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line... |
526046132 |
"""Importing necessary libraries"""
from sklearn.datasets import fetch_20newsgroups#inbuilt dataset from the sklearn library
import pandas as pd
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
import warnings
warnings.filterwarnings('ignore... | null | LDA.py | LDA.py | py | 5,362 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.fetch_20newsgroups",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_... |
253348011 | from django.urls import path
from . views import ContactList, ContactDetailView, ContactCreateView, ContactUpdateView, ContactDeleteView, SignUpView, search
urlpatterns = [
path('', ContactList.as_view(), name='home'),
path('detail/<int:pk>/', ContactDetailView.as_view(), name='single'),
path('search/', s... | null | app/urls.py | urls.py | py | 615 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.ContactList.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.ContactList",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls... |
587574258 | from typing import Tuple, Dict
import pandas as pd
NodeId = str
EdgeId = Tuple[NodeId, NodeId]
V = Dict[NodeId, any]
E = Dict[EdgeId, any]
CwnGraphData = Tuple[V, E]
AnnotationData: Dict[str, pd.DataFrame]
CheckResult = bool
MergeResult = Tuple[CwnGraphData, CheckResult] | null | CwnEdit/cwnedit_types.py | cwnedit_types.py | py | 272 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.Tuple",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 8... |
230457072 | #!/usr/bin/python
"""
Scriptname: helpscherm.py
Author: Jasper van Dalum & Soad Eldeb
Date: 24/1/2017
Version: 2.0
"""
import wx
from bruikbaar_methode import BoxVorm
from bruikbaar_methode import center
class Input(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id, style=wx.... | null | helpscherm.py | helpscherm.py | py | 1,618 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.Panel",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "wx.Panel.__init__",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "wx.Panel",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "wx.BORDER_SUNKEN",
... |
261530080 | # -*- mode: Python; -*-
# Implementation of a command-line tool ../rel-keepc,
# hopefully also usable with synthetic arguments in
# a Mylly (Chipster) tool, to be tested.
import sys
from .args import transput_args
from .args import BadData
from .names import makenames
from .data import readhead, groups
def parsearg... | null | rel-tools/librel/relkeepc.py | relkeepc.py | py | 1,831 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "args.transput_args",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "args.prog",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "names.makenames",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "args.field",
"l... |
67346077 | # coding:utf-8
import sys
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600, 500))
pygame.display.set_caption("画矩形")
myfont = pygame.font.Font(None, 60)
textImage = myfont.render("hello", True, (255, 255, 255))
x = 0
y = 0
isrigth = True
isleft = False
isup = False
isdonw =... | null | Learn/pygame/chap02/DrawingRectangles.py | DrawingRectangles.py | py | 1,093 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
322356429 | '''This is a shell for orchestrating experiments on AWS EC 2'''
import json
import os
import shutil
from functools import partial
from glob import glob
from subprocess import call, check_output, DEVNULL
from time import sleep, time
from joblib import Parallel, delayed
import boto3
import numpy as np
import zipfile
f... | null | shell.py | shell.py | py | 18,909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "subpr... |
286605981 | import logging
import inspect
from collections import namedtuple
from google.appengine.api import search as search_api
from google.appengine.ext import ndb
from .ndb import Behavior
def _datetime_coverter(n, v):
date = search_api.DateField(name=n, value=v)
iso = search_api.TextField(name=n + '_iso', value=v.i... | null | ferris3/search.py | search.py | py | 11,803 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.api.search.DateField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "google.appengine.api.search",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "google.appengine.api.search.TextField",
"line_number": 11,
"usage_type"... |
53800992 | import io
import os
import re
import sys
import json
import subprocess
import requests
import json
import config
import logging
from github import Github
from flask import Flask, request, abort, jsonify
from extract import Extract
from predict import Predict
app = Flask(__name__)
logging.basicConfig(filename='src/log... | null | src/emma.py | emma.py | py | 2,424 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"... |
84349719 | from django.core.files import File
from django.http import HttpResponse, HttpResponseForbidden
import magic
from .. import settings
def get_media_response(request, data, permissions=None, headers=None):
# For compatibility purpose
content, url = None, None
if isinstance(data, (File, )):
content, ... | null | terra_settings/helpers/responses.py | responses.py | py | 1,166 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.files.File",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "magic.from_buffer",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseForbidden",
"line_number": 23,
"usage_type": "call"
},
{
"api_na... |
453905621 | import vtk
def render_cleanpolydata(vtk_cleanpolydata):
"""
References:
- https://www.vtk.org/Wiki/VTK/Examples/Python/Filtering/CombinePolyData
"""
# Needed or not?
# Remove any duplicate points.
# Create a mapper and actor
#mapper = vtk.vtkPolyDataMapper()
#if vtk.VTK_MAJOR_VE... | null | model_02/renderer_vtk/fun_render_cleanpolydata.py | fun_render_cleanpolydata.py | py | 1,019 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "vtk.vtkPolyDataMapper",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "vtk.vtkActor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "vtk.vtkRenderer",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "vtk.vtkRenderWindo... |
645646167 | from __future__ import print_function
import json
import os
import sys
import datetime
from uuid import uuid4
from dcicutils.ff_utils import (
get_metadata,
post_metadata,
patch_metadata,
generate_rand_accession,
search_metadata
)
from core.nnested_array import (
flatten,
create_dim
)
from d... | null | core/pony_utils.py | pony_utils.py | py | 25,866 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 60,
"usage_type": "attribute"
},
{
"api_name": "uuid.uuid4",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
411966678 | import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QWidget, QApplication
from random import choice
from PyQt5.QtGui import QPainter, QColor
class CoolProgram(QWidget):
def __init__(self):
super().__init__()
uic.loadUi("UI.ui", self)
self.f = 1
self.btn.clicked.connect(sel... | null | draw_ellip.py | draw_ellip.py | py | 915 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "random.choice",
... |
251290529 | """
DIRBS dimension function for a IMEIs used buy international roamer.
Copyright (c) 2018-2020 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
limitations in the disclaimer below) provided that the follow... | null | src/dirbs/dimensions/used_by_international_roamer.py | used_by_international_roamer.py | py | 5,039 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base.Dimension",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "dirbs.utils.compute_analysis_end_date",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 76,
"usage_type": "call"
},
{
"api_name"... |
565468290 | # -*- coding: utf-8 -*-
import os
import re
from urllib.request import urlopen
import MeCab
import nltk
from sklearn.feature_extraction import stop_words as sk_stop_words
def clean(_text: str) -> str:
_text = remove_br(_text.expandtabs(1))
_text = remove_url(_text).strip()
return _text if _text != '' els... | null | seeking/seeking/utils/text_utils.py | text_utils.py | py | 3,286 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 22,... |
132155102 | import pygame, random
from tetris import board
display_width = 800
display_height = 600
screen = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption('pog')
surface_width = 200
surface_height = 480
cell_width = surface_width / 10
cell_height = surface_height / 24
grid_... | null | tetris_display.py | tetris_display.py | py | 3,489 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.display.set_mode",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "p... |
543283879 | import datetime
import hashlib
import json
import math
import random
from threading import Thread, Event
from planner.cbs_ext_test import get_data_random
from planner.eval.eval_scenarios import get_costs
from planner.tcbs.plan import generate_config, plan, pre_calc_paths
from tools import benchmark, mongodb_save, is_c... | null | planner/eval/eval_comparison_test.py | eval_comparison_test.py | py | 4,684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "threading.Thread",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "planner.m... |
642900890 | # -*- coding: utf-8 -*-
import lemoncheesecake.api as lcc
from common.base_test import BaseTest
SUITE = {
"description": "Test 'Registration API'"
}
@lcc.suite("Test registration methods")
class TestRegistrationMethod(BaseTest):
def __init__(self):
super().__init__()
self.__resp = None
... | null | suites/test_registration_api.py | test_registration_api.py | py | 1,060 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.base_test.BaseTest",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "lemoncheesecake.api.set_step",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lemoncheesecake.api",
"line_number": 22,
"usage_type": "name"
},
{
"api_na... |
716718 | #!/usr/bin/env python3
# Chaochih Liu - Falcon Heights, MN June 17, 2019
"""This script renames SRA/fastq files obtained from NCBI SRA or any other type of file.
This script takes in a tab-delimited lookup table with two columns:
1) Old name (Run/Exp/SRA ID/Accession name excluding file extension)
2) New name n... | null | rename_files.py | rename_files.py | py | 4,540 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "os.rename",
"line_n... |
434968124 | import sqlite3 as lite
import re
import string
import xml
# -*- coding: utf-8 -*-
class ConvertHtmlToSqlite(object):
def __init__(self):
self.parenthesisRe = re.compile(r'\([^)]*\)')
self.tagRe = re.compile(r'(\s)*<[^>]+>')
self.characters = list('\xd7\xa4\xd7\x9d\xd7\x9f\xd7\x95\xd7\x98\xd... | null | chatbot/WordsDb/html_to_db.py | html_to_db.py | py | 1,964 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
}
] |
154627499 | ## Copyright 2016 Kurt Cutajar, Edwin V. Bonilla, Pietro Michiardi, Maurizio Filippone
##
## 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... | null | code1.0/experiments/dgp_clustering.py | dgp_clustering.py | py | 3,928 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.loadtxt",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_n... |
522678739 | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from ui.ui_modeselection import Ui_Modeselection
class Qdialog_modeselection(QtWidgets.QDialog):
# self-defined signals
game_parameters = pyqtSignal(int, float, int, int, float, int, bool, bool)
def __init__(self, parent=None... | null | modeselection.py | modeselection.py | py | 2,266 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ui.... |
190917268 | import os
import time
from django.conf import settings
from django.shortcuts import redirect, render
from .models import *
# Create your views here.
def random_view(request):
p = Photo.objects.order_by('?').first()
return redirect('show', id=p.pk)
#return render(request, 'pics/random.html', {'photo':p})
... | null | pics/views.py | views.py | py | 1,654 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 31,
"usage_type": "call"
},
{
"api... |
35640 | # -*- coding: utf-8 -*-
from random import randrange
import pytest
from fixture.TestBase import clear
from fixture.variables import Profinity
from tests_contract.contact_helper import Contact
from data.add_contact import constant as test_data
@pytest.mark.parametrize('contact', test_data, ids=[repr(x) for x in test... | null | tests_contract/test_contract.py | test_contract.py | py | 4,282 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tests_contract.contact_helper.Contact.if_or_max",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "tests_contract.contact_helper.Contact",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 12,
"... |
14215241 | # -*- coding: utf-8 -*-
'''
摔倒检测模型主程序
用法:
python testingfalldetection.py
python testingfalldetection.py --filename tests/corridor_01.avi
'''
# import the necessary packages
from keras.preprocessing.image import img_to_array
from keras.models import load_model
import numpy as np
import cv2
import time
import argparse
... | null | oldcare/preprocessing/testingfalldetection.py | testingfalldetection.py | py | 2,076 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.