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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
648764282 | import sys
import numpy as np
from numba import jit
from scipy.stats import dirichlet,halfcauchy,uniform
from scipy.special import erf
@jit
def Support(rc):
if rc <= 0 : return -np.inf
@jit
def Number(r,rc,Rmax):
return (CDF(r,rc)/CDF(Rmax,rc))
@jit
def CDF(r,rc):
x = (r/rc)**2
frac = (1-np.exp(-x/2... | null | MultiNest/Models/Gaussian.py | Gaussian.py | py | 1,701 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.inf",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numba.jit",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "numba.jit",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "numpy.exp",
"line_number": 18,
... |
289167113 | '''
Authors
- C. Selmi: written in 2020
'''
import os
import numpy as np
import zmq
import h5py
import time
from m4.ground import rebinner
from m4.configuration import config_folder_names as fold_name
from m4.configuration.ott_parameters import OpcUaParameters
from matplotlib import pyplot as plt
from m4.ground.time... | null | m4/utils/accelerometer_data.py | accelerometer_data.py | py | 10,798 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "m4.configuration.ott_parameters.OpcUaParameters.accelerometers_dt",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "m4.configuration.ott_parameters.OpcUaParameters",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "m4.configuration.ott_param... |
640850682 | #!/usr/bin/env python3
import sys, os, json, argparse, random, math, datetime
from dwave.cloud import Client
import bqpjson
import combis
json_dumps_kwargs = {
'sort_keys':True,
'indent':2,
'separators':(',', ': ')
}
# prints a line to standard error
def print_err(data):
sys.stderr.write(str(data)... | null | dwisc.py | dwisc.py | py | 10,601 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.stderr.write",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_numb... |
472313209 | import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
df = pd.read_csv("data_methanol.csv")
features = ["resonance frequency","Q factor"]
y1 = df["e\'"]
y2 = df["e''"]
data = df[features]
f = float(input('Enter the ... | null | main_methanol.py | main_methanol.py | py | 1,166 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.PolynomialFeatures",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 21,
"usage_type": "call"
... |
291641418 | # coding=utf-8
import logging
import os
import time
from functools import wraps
PATH = lambda p: os.path.abspath(
os.path.join(os.path.dirname(__file__), p)
)
class Log:
def __init__(self):
log_dir = PATH("../logs")
if not os.path.exists(log_dir):
os.makedirs(log_dir)
sel... | null | utils/base_log.py | base_log.py | py | 1,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9... |
425018988 | import sys
from cx_Freeze import setup, Executable
build_exe_options = {"includes": ["tkinter"]}
base = None
if sys.platform == "win32":
base = "Win32GUI"
setup(
name = "HackThisMifare",
version = "1.0",
description = "Le jeu pour connaître et exploiter les vulnérabilités du système Mifare",
opt... | null | setup.py | setup.py | py | 455 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.platform",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cx_Freeze.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cx_Freeze.Executable",
"line_number": 15,
"usage_type": "call"
}
] |
554468047 | #!/usr/bin/python
import jinja2
shared_integration_tests = [
'coda-peers-test',
'coda-transitive-peers-test',
'coda-block-production-test',
'coda-shared-prefix-test -who-proposes 0',
'coda-shared-prefix-test -who-proposes 1',
'coda-shared-state-test',
# FAILING 'coda-restart-node-test',
]
... | null | .circleci/render.py | render.py | py | 1,881 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jinja2.Environment",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 70,
"usage_type": "call"
}
] |
48149305 | import pytz
import discord
import time
import asyncio
from bin import SocketServer
import mysql.connector
from threading import Thread
from datetime import datetime
from discord.ext import commands
from bin.importantFunctions import s, sleep, STDPREFIX
def timestring(deltatime):
hours = int(deltatime.seconds/60/60)
... | null | bin/twitch.py | twitch.py | py | 14,170 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "bin.importantFunctions.STDPREFIX",
"line_number": 27,
"usage_type": "name"
},
{
... |
272940739 | from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
cnt = defaultdict(int)
ans = 0
for i, a in enumerate(A, start=1):
ans += cnt[-a + i]
cnt[a + i] += 1
print(ans)
| null | AtCoder/abc/166e.py | 166e.py | py | 211 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
}
] |
270198469 | import matplotlib.pyplot as plt
import numpy as np
#----------------------------Import Data--------------------------------------
with open("\\Users\\Hector\\Desktop\\Data\\KC10 map.txt", "r") as KC10:
KC10_raw = KC10.readlines()
with open("\\Users\\Hector\\Desktop\\Data\\LiC10 map.txt", "r") as Li... | null | Composite Map (D norm).py | Composite Map (D norm).py | py | 5,762 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
305094526 | import re,urllib,json,string,xbmc,urllib2,cookielib
def resolve_tvplayer(url):
watchHtml=getUrl(str(url))
channelid=re.findall('resourceId = "(.*?)"' ,watchHtml)[0]
validate=re.findall('var validate = "(.*?)"' ,watchHtml)[0]
cj = cookielib.LWPCookieJar()
data = urllib.urlencode({'service':'1','platf... | null | script.module.7of9-pirateslife4me/resources/modules/tvplayer.py | tvplayer.py | py | 3,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.findall",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cookielib.LWPCookieJar",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"lin... |
597603254 | # 10
# 450
# 550
import torch
import numpy as np
import open3d as open3d
import config
import math
from nms import nms
type2class = {'bed': 0, 'table': 1, 'sofa': 2, 'chair': 3, 'toilet': 4, 'desk': 5, 'dresser': 6, 'night_stand': 7,
'bookshelf': 8, 'bathtub': 9}
class2type = {0: 'bed', 1: 'table', 2: 'sofa', 3... | null | boxnet/show_bb.py | show_bb.py | py | 8,767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
2622285 | import gym
import pytest
import robo_gym
envs = [
'NoObstacleNavigationMir100Sim-v0',
'ObstacleAvoidanceMir100Sim-v0',
'EndEffectorPositioningUR10Sim-v0',
'EndEffectorPositioningUR10DoF5Sim-v0',
'EndEffectorPositioningUR5Sim-v0',
'EndEffectorPositioningUR5DoF5Sim-v0'
]
@pytest.mark.param... | null | tests/robo-gym/envs/test_gym.py | test_gym.py | py | 727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.make",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pytest.mark.filterw... |
620579186 | #!/opt/local/bin/python
#coding: utf-8
import oauth2
from urllib import urlencode
CONSUMER_KEY = 'Vz79FY6sN6GIYayTqSHXyEq0Zjs08yv0IbD1vz4NFZWSF9TuR9'
CONSUMER_SECRET = '6j1ntPLz7zKeC2QdeJOJGoebu0Qnb5UGNauaUx8oWHArpwrzQi'
ACCESS_TOKEN = 'R2SWpBtVETlcnEPDI0UX47ffhZ4Pz5lCrUtSdpYyeMwUZyVCup'
ACCESS_TOKEN_SECRET = 'm2vxL... | null | tumblr/testpost.py | testpost.py | py | 1,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "oauth2.Token",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "oauth2.Consumer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "oauth2.Client",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "urllib.urlencode",
"li... |
538319533 | from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWidgets import QPushButton, QLineEdit,QLabel
from PyQt5.QtGui import QPixmap
import sys
SCREEN_SIZE = [400, 400]
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeomet... | null | 3.ред/test.py | test.py | py | 757 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtGui.QPixmap",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PyQ... |
449364236 | # t指文本模式。r和rt和w和wt与之间没有区别,wt因为文本模式是默认模式。
from lxml import etree
import requests
import csv
fp = open('F:\PY\liantong\豆瓣图书.csv', 'wt', newline='', encoding='utf-8')
writer = csv.writer(fp)
writer.writerow(('name', 'url', 'author', 'publisher', 'date', 'price', 'rate', 'comment')) # 手动写入内容
urls = ['https://book.douban.c... | null | Python爬虫/doubanbookDemo.py | doubanbookDemo.py | py | 1,599 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.writer",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number"... |
60102771 | import numpy as np
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from pyflann import *
from itertools import chain
from time import time
import threading
# 近邻算法类
flann = FLANN()
mnist = input_data.read_data_sets('MNIST_data', one_hot=False)
# 整理MNIST图像类
images = []
for i in range... | null | MNIST.py | MNIST.py | py | 1,802 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "tensorflow.examples.tutorials.mnist.input_data",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number"... |
647576762 | # ------------------------------------------------------------------------------
# Question 3.5 - Sort Stack
#
# Problem:
# Write a program to sort a stack such that the smallest elements are on the
# top using only one additional stack.
#
# Solution: O(n^2)
# We can adapt the insertion sort algorithm to sort th... | null | ch3/3.05_Sort_Stack/sort_stack.py | sort_stack.py | py | 943 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.stack.Stack",
"line_number": 19,
"usage_type": "call"
}
] |
124048993 | import json
from tqdm import tqdm
import requests
with open("data\\DataLunch.json") as input_file:
data = json.load(input_file)
with open("cfg\\cluster_node.json") as cfg_file:
cfg = json.load(cfg_file)
DataLunch = data["DataLunch"]
Consumers = cfg["roots"]
def prepare(data_lunch):
data_list = list(ma... | null | cluster_application/fact/cluster_utils/logic_function.py | logic_function.py | py | 1,027 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 36,
... |
450780106 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | null | docs/conf.py | conf.py | py | 5,945 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
118354938 | from __future__ import absolute_import
import os
import io
from hashlib import sha1
from django.core.files.base import ContentFile
from six.moves import xrange
from sentry.testutils import TestCase
from sentry.tasks.assemble import assemble_dif, assemble_file
from sentry.models import FileBlob, FileBlobOwner
from s... | null | tests/sentry/tasks/test_assemble.py | test_assemble.py | py | 3,706 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sentry.testutils.TestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.core.files.base.ContentFile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.core.files.base.ContentFile",
"line_number": 33,
"usage_type": "call"... |
265438105 | import cv2
import numpy as np
from pykeyboard import PyKeyboard
k = PyKeyboard()
lower_yellow=np.array([20,80,90])
upper_yellow=np.array([40,255,255])
def drawcircle(img,lower,upper):
imghsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
#print(imghsv)
redobj=cv2.inRange(imghsv,lower,upper)
a,co... | null | students/zengkexiang/20200403/trace.py | trace.py | py | 2,204 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pykeyboard.PyKeyboard",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_n... |
344614737 | from django.shortcuts import render
from .models import YoutubeVideo, VideoFeed, YoutubeFeed
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from django.conf import settings
from django.views.decorators.cache import cache_page
# Creat... | null | clips/views.py | views.py | py | 1,068 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "django.core.cache.backends.base.DEFAULT_TIMEOUT",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "models.YoutubeVideo.objects.all",
"line_number": 15,
"usage_... |
390404431 | import pygame
from config import FPS, BLACK, Points, PLAYING, DONE
from assets import load_assets
def gameover_screen (window):
# Variável para o ajuste de velocidade
clock = pygame.time.Clock()
# Carrega os assets
assets = load_assets()
# ===== Loop principal =====
gameover = True... | null | gameover_screen.py | gameover_screen.py | py | 940 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.time.Clock",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "assets.load_assets",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "config.FPS",
... |
460845475 | import pytest
from starlette.testclient import TestClient
from app.main import app
from app.schemas import UserCreate
from app.tests.utils import fake, random_string
from app.db.base import create_all, SessionLocal, reset_db
@pytest.fixture(autouse=True)
def _():
create_all()
@pytest.fixture(scope="session")
d... | null | {{ cookiecutter.project_slug }}/app/tests/conftest.py | conftest.py | py | 642 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app.db.base.create_all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.db.base.SessionLocal",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.db... |
438198972 | import logging
class LogCustom():
def __init__(self,level = logging.DEBUG):
self.lg = logging.getLogger('myLog')
self.lg.level = level
def logger(self):
fmt = logging.Formatter(fmt='%(asctime)s [%(pathname)s:%(lineno)d 行]| %(levelname)s | %(message)s | %(funcName)s',
... | null | config/logConfig.py | logConfig.py | py | 638 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.StreamHan... |
416751391 | import logging
import os
# define the name of the directory to be created
def createLogFolder():
path = "./logs"
try:
os.mkdir(path)
except OSError:
print("Creation of the directory %s failed" % path)
else:
print("Successfully created the directory %s " % path)
def setup_log... | null | old/final/NoSQLFlows/logger_module.py | logger_module.py | py | 904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.mkdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "logging.FileHandler",
... |
219796290 | # Title : _8humanPredict.py
# Created by: julse@qq.com
# Created on: 2021/3/3 10:00
# des : TODO
import os
import time
import pandas as pd
from FastaDealear import FastaDealer
from FeatureDealer import BaseFeature, Feature_type
from common import check_path, concatFile
from dao import generateHumanLists, composeTMP... | null | _8MYCPNPredict.py | _8MYCPNPredict.py | py | 4,189 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numbe... |
476652634 | import os.path
import numpy as np
import matplotlib.pyplot as plt
import scipy as spy
import pandas as pd
import time
from sklearn.ensemble import RandomForestClassifier
from sklearn import linear_model
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScal... | null | csci3320/project/classification2.py | classification2.py | py | 10,692 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "timeit.... |
424820943 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
import traceback
import json
from rq.timeouts import JobTimeoutException
import smtplib
import quopri
from email.parser import Parser
import frappe
from frappe import _, safe_encode, t... | null | frappe/email/doctype/email_queue/email_queue.py | email_queue.py | py | 9,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "frappe.model.document.Document",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "frappe.session",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "frappe.throw",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "frapp... |
634762102 | import datetime
import os
import sys
from celery.schedules import crontab
from datetime import timedelta
# import apps.search.tasks
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
APPS_DIR = os.path.join(BASE_DIR, "apps")
sys.path.append(APPS_DIR)
SECRET_KEY = os.environ.get("SECRET_KEY", ... | null | settings/dev.py | dev.py | py | 5,924 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
370849270 | import pywt
import pandas as pd
import numpy as np
from statsmodels import robust
import math
from study_noise import visualise, summarise
import study.module.module_datasets as datasets
def trim_coefficients(wavelet_coeffs):
"""
The time series can be denoised by removing some coefficients from the projectio... | null | study/study_dwt.py | study_dwt.py | py | 3,979 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pywt.threshold",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "statsmodels.robust.mad",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "statsmodels.robust",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "math.sqrt",
... |
371926572 | import numpy as np
import os
from utils.util import gdal_trans
def checkArgs(args, p):
'''
Helper fcn for checking argument compatibility and returns the
correct variables
'''
import models
if args.heightlvs is not None and args.outformat != 'hdf5':
raise ValueError('HDF5 must be used ... | null | tools/RAiDER/checkArgs.py | checkArgs.py | py | 5,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "utils.constants.Zenith",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "utils.util.gdal_trans",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
177624802 | #
# IMPORT
#
import tensorflow.compat.v1 as tf
import pygame
import math
import car
import wall
import os
import gym
import random
import numpy as np
from collections import deque
tf.disable_v2_behavior()
# pygame.init()
playerScale = 0.01
def drawGoals():
for g in goals:
pygame.draw.line(env.gameDispl... | null | game_2.py | game_2.py | py | 13,353 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.compat.v1.disable_v2_behavior",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tensorflow.compat.v1",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "pygame.draw.line",
"line_number": 24,
"usage_type": "call"
},
{
"ap... |
633213156 | import xlrd
class OperaExcel:
def __init__(self,filename=None):
if filename:
self.filename = filename
else:
self.filename = "../config/case.xls"
self.data = self.read_data()
self.sheet_data = self.read_sheet()
def read_data(self):
data = xlrd.ope... | null | venv/util/opera_excel.py | opera_excel.py | py | 943 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 13,
"usage_type": "call"
}
] |
286483624 | import Cryptodome.Cipher.AES as AES
import Cryptodome.Random as Random
class EncoDecode:
def __init__(self):
self._Key = None
self.bs = 32
def setKey(self, key):
#self._Key=key
self._Key = Random.new().read(32)
self._value = Random.new().read(AES.block_size)
... | null | TP3/EncDecode.py | EncDecode.py | py | 1,628 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Cryptodome.Random.new",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "Cryptodome.Random",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "Cryptodome.Random.new",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Cryptod... |
627609889 | #### IMPORTS #######################################################################################
from Tkinter import Tk, Label, Toplevel, Menu, Text, END, PanedWindow, Frame, TOP, Button, IntVar, HORIZONTAL, \
RAISED, BOTH, VERTICAL, Menubutton, Message, Canvas, NW, Scrollbar, BOTTOM, RIGHT, LEFT, X, Y, SUNKEN
... | null | Andrea/CALIPSO_Visualization_Tool.py | CALIPSO_Visualization_Tool.py | py | 11,554 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Tkinter.Label",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "Tkinter.PanedWindow",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Tkinter.BOTH",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "Tkinter.PanedWindow",
... |
5215725 | import os
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as data
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from model.gatedPixelCNN import GatedPixelCNN
from dataIO.utils import *
###################################... | null | pixel_cnn_mnist.py | pixel_cnn_mnist.py | py | 3,059 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.utils.data.DataLoader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.utils.data",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torchvision.datasets.MNIST",
"line_number": 20,
"usage_type": "call"
},
{
"api_name"... |
530288823 | # -*- coding: utf-8 -*
from util import *
import datetime
class CNTrade(object):
def __init__(self):
self.email = Email()
self.client = client(host="10.104.236.87")
# 每日更新
self.last_trade_time = get_trade_date_series("CN")
self.trade_time = get_date_now("CN")
self.i... | null | trade/cn_trade.py | cn_trade.py | py | 2,483 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dateti... |
221341365 | # -*- coding: utf-8 -*-
# ****************************************************************
# CheckNerds - www.checknerds.com
# version 1.0, codename Nevada
# - miscellaneous.py
# Copyright (C) CNBorn, 2008
# http://blog.donews.com/CNBorn, http://twitter.com/CNBorn
#
# *************************************************... | null | miscellaneous.py | miscellaneous.py | py | 11,199 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.appengine.ext.db.GqlQuery",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "google.appengine.api.users.get_current_user",
"line_number": 41,
"usage_type": "... |
413969293 | """ A script for training a DDPG agent in the multi-agent Tennis environment of Udacity Deep Reinforcement Learning nanodegree (Project 3).
Learning statistics will be printed in the standard output; a plot of the progress will be saved in file training.png.
After completion, neural network weights will be saved in fil... | null | train.py | train.py | py | 3,434 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "unityagents.UnityEnvironment",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
621472259 | # -*- coding: utf-8 -*-
import csv
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn import preprocessing
from sklearn.preprocessing import Imputer
def loadData(dataType):
data = pd.read_csv(filepath_or_buffer='//Users//jumdar//documents//demo//数据//Load_history.cs... | null | process.py | process.py | py | 4,149 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.Stan... |
83974219 | # uncompyle6 version 3.6.7
# Python bytecode 2.6 (62161)
# 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: /usr/local/plone-production-nbf-1/zeocluster/src/Products.BlobNewsItem/PasteScript-1.7.5-py2.6.egg/paste/script/twisted_web2_server.py
#... | null | pycfiles/Products.BooleanIndex-1.0.2/twisted_web2_server.py | twisted_web2_server.py | py | 979 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "twisted.web2.wsgi.web2.wsgi.WSGIResource",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "twisted.web2.wsgi.web2",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "twisted.web2.wsgi",
"line_number": 11,
"usage_type": "name"
},
{... |
52400885 | # uncompyle6 version 3.7.4
# Python bytecode 2.4 (62061)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.macosx-10.3-i386/egg/easyshop/customers/adapters/customer_management.py
# Compiled at: 2008-09-03 11:14:43
from zope.interface import implements
from... | null | pycfiles/easyshop.customers-0.1a1-py2.4/customer_management.py | customer_management.py | py | 3,905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zope.interface.implements",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "easyshop.core.interfaces.ICustomerManagement",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "zope.component.adapts",
"line_number": 24,
"usage_type": "call... |
4957892 | from multiprocessing import Pool, Manager, cpu_count
from PostgresProvider import Provider
import os
import re
# from tqdm import tqdm
from random import shuffle
import time
import pandas as pd
import numpy as np
import datetime
from sklearn.neural_network import MLPRegressor
from Log import Log
test_hour = 14
test_... | null | LottoGenerator/LottoGenerator.py | LottoGenerator.py | py | 11,791 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Log.Log",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number": ... |
434424291 | from django.shortcuts import render, redirect
from django.http import Http404, HttpResponseRedirect, HttpResponse, JsonResponse
import json
from .models import Event
from Battles.models import Battle, Participent
app_name = 'events'
def events(request):
latest_events_list = Event.objects.order_by('-publish_date')... | null | CodeBattle/apps/events/views.py | views.py | py | 3,716 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Event.objects.order_by",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "models.Event.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Event",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "dja... |
355418155 | import ffmpy
inputFormat = '.mp4'
outputFormat = '.avi'
for filename in os.listdir(folder_path):
if filename.__contains__(fileformat):
outputName, extension = inputFormat.split(".")
ff = ffmpy.FFmpeg(inputs={filename: None}, outputs={outputName + outputFormat: None})
ff.run()
| null | batch convert video file format/video_converter.py | video_converter.py | py | 308 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ffmpy.FFmpeg",
"line_number": 9,
"usage_type": "call"
}
] |
358796843 | import urllib.request
import sys
import json
def weather(city_name=''):
try:
if len(city_name)>0 and city_name != None:
""" replace spaces with %20 """
city_name = city_name.replace(" ",'%20')
""" API key """
api_key='95b8f13ab7f6f3d6518f4ccadf4300ae'
""" using google weather API """
url='http:... | null | app.py | app.py | py | 1,183 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_nam... |
128642277 | import numpy as np
import os.path as osp
from collections import defaultdict
import numpy as np
import random
img_dir_root = './data/vehicleID'
train_list_dir = osp.join(img_dir_root,'train_test_split')
train_list_path = osp.join(train_list_dir,'train_list.txt')
test_list_path = osp.join(train_list_dir, 'test_list_')
... | null | data_preprocessing.py | data_preprocessing.py | py | 2,366 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"u... |
120924750 | import pommerman
import pommerman.agents as agents
import pommerman.utility as utility
from pommerman.constants import Action
from pommerman.envs.v0 import Pomme
from pypomcpp.clib import CLib
import time
import ctypes
import json
class CppAgent(agents.BaseAgent):
def __init__(self, library_path, agent_name: str, ... | null | py/pypomcpp/cppagent.py | cppagent.py | py | 3,543 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pommerman.agents.BaseAgent",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pommerman.agents",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pypomcpp.clib.CLib",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "c... |
334875929 | from .message import message
from lib import is_value
def __format_options(options):
opt_arr = []
for i in range(len(options)):
opt_arr.append("{}) {}".format(str(i + 1), options[i]))
return opt_arr
def __print_options(options):
for opt in options:
print(opt)
def get_player_action(i... | null | utils/get_player_action.py | get_player_action.py | py | 712 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "message.message",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "lib.is_value.number",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "lib.is_value",
"line_number": 25,
"usage_type": "name"
}
] |
250082997 | import sqlite3
import os
class Model(object):
def __init__(self,parent):
self.parent = parent
self.gDB=GestionBD(self)
self.cwd = os.getcwd()
os.chdir("..\Maquette")
self.maquetteDir = os.getcwd()
self.maquetteList = os.listdir(self.maquetteDir)
print(self.ma... | null | 2011-10-12--_a_integrer/ManifesteAgileJMD/ModelMA_JMD.py | ModelMA_JMD.py | py | 3,742 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"u... |
105983209 | """
Observable.py
@author: stevetheodore
"""
import itertools
from mGui.bindings import BindableObject
from mGui.events import MayaEvent, Event
class ObservableCollection(BindableObject):
"""
Encapsulates a collection suitable for data binding. The contents are
managed internally but visible to other cla... | null | mGui/observable.py | observable.py | py | 7,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mGui.bindings.BindableObject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "mGui.events.MayaEvent",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "mGui.events.MayaEvent",
"line_number": 38,
"usage_type": "call"
},
{
"api_name... |
541139056 | # stdlib
from typing import Any
from typing import Dict
# relative
from .....telemetry import instrument
from ...abstract.node import AbstractNodeClient
from ...enums import AssociationRequestResponses
from ...enums import RequestAPIFields
from ...enums import ResponseObjectEnum
from ...exceptions import PyGridClientE... | null | packages/syft/src/syft/core/node/common/client_manager/association_api.py | association_api.py | py | 3,872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "request_api.RequestAPI",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "abstract.node.AbstractNodeClient",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "node_service.association_request.association_request_messages.SendAssociationRequestMessa... |
441503432 | from .models import *
import datetime
import openpyxl
from pathlib import Path
import random
import re
class ImportData:
def __init__(self):
super().__init__()
def getID(self, s):
res = '0000'+str(s)
return 'pa'+res[-4:]
def get_data(self):
# new_entry = Albumin(patient_I... | null | QoL/main/data.py | data.py | py | 7,072 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.split",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
466246817 | """Setup titiler-application."""
from setuptools import find_namespace_packages, setup
with open("README.md") as f:
long_description = f.read()
inst_reqs = [
"rio-cogeo>=2.2",
"titiler.core",
"titiler.mosaic",
"brotli-asgi>=1.0.0",
"python-dotenv",
]
extra_reqs = {
"test": ["pytest", "pyt... | null | src/titiler/application/setup.py | setup.py | py | 1,497 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.setup",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "setuptools.find_namespace_packages",
"line_number": 42,
"usage_type": "call"
}
] |
213569681 | import pytest
from pages.loggedin_driver import Driver
from pages.hiway import HighWay
from pages.timesheet import TimeSheet
from ddt import ddt, data, unpack
from utility.data import get_csv_data
from utility.constants import *
import logging
ttime_logger = logging.getLogger(__name__)
ttime_logger.setLevel(logging.IN... | null | tests/test_timesheet1.py | test_timesheet1.py | py | 4,687 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "logging.Formatter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.FileHan... |
574000330 | '''
Created on 28/02/2020
Once created, this file must not be changed.
'''
import pandas as pd
from copy import deepcopy
import numpy as np
import HyperparameterTuning_XG as HT
from Utilities import computeSampleWeights
import time
import xgboost as xgb
import PrepareTrainingData as data
import Utilities as ut
imp... | null | FullRun-XG.py | FullRun-XG.py | py | 23,241 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "PrepareTrainingData.GetAllFinancialReportsDataPoints",
"line_number": 79,
"usage_type": "call"
},
{
"a... |
654358574 | import polowrapper
import requests
import json
from key import *
from PyQt5 import QtCore, QtGui, QtWidgets
import mainwindow
from PyQt5 import *
from PyQt5.QtCore import *
class GetPoloinfothread(QThread):
def __init__(self, ui_instance):
self.ui = ui_instance
super(QThread, self).__init__()
... | null | polocaller.py | polocaller.py | py | 2,578 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "polowrapper.poloniex",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "polowrapper.poloniex",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "polowrapper.poloniex",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "reques... |
492018018 | # -*- coding: utf-8 -*-
""" iRODS file-system flask connector """
# TODO: b2access
import os
import logging
from irods.session import iRODSSession
from rapydo.utils.certificates import Certificates
from rapydo.confs import PRODUCTION
from flask_ext import BaseExtension, get_logger
from flask_ext.flask_irods.client i... | null | flask_ext/flask_irods/__init__.py | __init__.py | py | 7,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask_ext.get_logger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_ext.Ba... |
411338424 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
import numpy as np
import sys
style.use('fivethirtyeight')
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
fin = False
def animate(i):
data = open("error",'r').read()
lines = data.split("\n")
xs = []
... | null | entrega/virtual_line_following/log.py | log.py | py | 607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.style.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.style",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotli... |
237082975 | import BlynkLib
import time
import logging
logging.basicConfig(level=logging.DEBUG)
auth_token = 'e2c8b529c9574d5f9a732fe97d810b4a'
def virtual_write_callback(value, pin, state, blynk_ref):
print(value)
# access the neccessary virtual output and write the value
return
def now_in_ms():
millis = int... | null | BlynkController.py | BlynkController.py | py | 640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "BlynkLib.Blynk",
"... |
113563537 | """
Tests for ModuleStructure
module: doc_extract.parse.structures
"""
import pytest
from doc_extract.parse.objects import ParsedModule, ParsedClass, ParsedFunction
from doc_extract.parse.structures import CodeStructure, ModuleStructure
from doc_extract.tests.th.mixins import repr_should_be_defined, str_should_be_defin... | null | doc_extract/tests/parse/structures/test_module_structure.py | test_module_structure.py | py | 4,884 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "doc_extract.parse.structures.ModuleStructure",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "doc_extract.parse.structures.CodeStructure",
"line_number": 23,
"usage_type": "argument"
},
{
"api_name": "doc_extract.parse.structures.ModuleStructure",
... |
402285568 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from gevent import monkey
from gevent import queue
monkey.patch_all() # NOQA
from streql import equals
import gevent
import falcon
import ujson
import os
import logging
import re
import zipfile
import requests
from datetime import datetime, timedelta
import shutil
logger ... | null | nightswatcher/nightswatcher.py | nightswatcher.py | py | 9,097 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "logging.StreamH... |
205603200 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views import defaults as default_views
from django.views.generic import TemplateView
from re... | null | gmp/config/urls.py | urls.py | py | 6,834 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rest_framework_nested.routers.SimpleRouter",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "rest_framework_nested.routers",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "gmp.apps.departments.views.DepartmentViewset",
"line_number": 27,
... |
232246193 | import os,random
from flask import *
import json
from kafka import KafkaProducer
from time import sleep
from flask import Flask
from flask import request
import json
import sys
import json
import requests
import os
import random
import threading
import monitorInit as mon
import json
import time
from json import dumps
... | null | src/demo1/serverLifeCycleMgr/platformRepository/deployer/src/deployer.py | deployer.py | py | 3,209 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "kafka.KafkaProducer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_n... |
539256945 | import sys
import file_helper as fh
import lxml.etree as ET
script_name = sys.argv
files_to_process = fh.filter_files_by_suffix(fh.files_to_process("../l2j_datapack/dist/game/data/stats/items"), ".xml")
def insert_after(element, new_element):
parent = element.getparent()
parent.insert(parent.index(element)+1... | null | tools/reorder_set_elements.py | reorder_set_elements.py | py | 905 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "file_helper.filter_files_by_suffix",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "file_helper.files_to_process",
"line_number": 7,
"usage_type": "call"
},
{
"api_na... |
510512887 | import numpy as np
import pandas as pd
def calculateReturns(prices, lag):
# =============================================================================
# prices is a pandasDataFrame type
# =============================================================================
prevPrices = prices.shift(lag)
ret... | null | functions.py | functions.py | py | 1,998 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number":... |
329508701 | import pickle
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import glob
import os.path
def get_calibration(camera_calibration_pickle = 'dist_pickle.p', force=False):
if force is True or not os.path.isfile(camera_calibration_pickle):
return calibrate()
else:
... | null | camera_calibration.py | camera_calibration.py | py | 2,023 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.path.isfile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line... |
294544815 | from os import mkdir, system
from os.path import exists, join, pardir
from shutil import rmtree
from nose.tools import assert_equals, assert_true
from tvrenamr.tests.base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
if exists(self.renamed):
... | null | tvrenamr/tests/test_frontend.py | test_frontend.py | py | 4,221 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tvrenamr.tests.base.BaseTest",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "shutil.rmtree",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
... |
477773108 | import functools
import inspect
import itertools
import logging
import math
import queue
import random
import signal
import sys
import threading
if sys.implementation.name == 'cpython':
_LOWEST_VERSION = (3, 6)
else:
_LOWEST_VERSION = (3, 7)
if sys.version_info >= _LOWEST_VERSION:
_dict = dict
else:
f... | null | fret/util.py | util.py | py | 8,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.implementation",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "collections.OrderedDict",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
516628224 | from django.urls import path, include
from customers.views import signup_user, logout_user, login_user, user_profile
urlpatterns = [
path('profile/<int:pk>/', user_profile, name='user profile'),
path('signup/', signup_user, name='signup user'),
path('logout/', logout_user, name='logout'),
path('login... | null | customers/urls.py | urls.py | py | 354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "customers.views.user_profile",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "custo... |
562683957 | import json
import typing as t
from operator import methodcaller, attrgetter
from unittest import mock
from dataclasses import dataclass, field
from toolz import compose
import snug
from snug import Request
@dataclass
class Post:
id: int
title: str
@dataclass
class Comment:
id: int
text: str
... | null | tests/test_query.py | test_query.py | py | 6,433 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datacla... |
621344059 | import pandas as pd
import numpy as np
from ast import literal_eval
from datetime import datetime
from tensorflow import keras
from keras.preprocessing.text import Tokenizer as tf_tokenizer
from keras.preprocessing.sequence import pad_sequences
import model_creation
import model_training
import model_evaluation
# ---... | null | python_scripts/main_rnn.py | main_rnn.py | py | 2,805 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "ast.literal_eval",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "model_creation.convert_to_string",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_na... |
501018687 | # -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send(title="Quiz Alert", content="", From = "Quiz Alert", To = ""):
server = smtplib.SMTP_SSL(host="smtp.gmail.com", port=465)
server.login("xxx", "yyy")# xxx is sender address. yyy... | null | send_mail.py | send_mail.py | py | 900 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "smtplib.SMTP_SSL",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 14,
"usage_type": "call"
}
] |
415367341 | # -*- coding: utf-8 -*-
# _pulse.py
# This module provides the pulse function.
# Copyright 2013 Giuseppe Venturini
# This file is part of python-deltasigma.
#
# python-deltasigma is a 1:1 Python replacement of Richard Schreier's
# MATLAB delta sigma toolbox (aka "delsigma"), upon which it is heavily based.
# The delta... | null | deltasigma/_pulse.py | _pulse.py | py | 4,407 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_utils.carray",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "numpy.nditer",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "_utils.rat",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "_utils.lcm",
"line_number":... |
9548193 | import re
import telnetlib
# import random
import redis
import requests
class IpTest(object):
def __init__(self):
self.pool = redis.ConnectionPool(host='127.0.0.1', port=6379, max_connections=10)
self.connect = redis.Redis(connection_pool=self.pool, decode_responses=True)
self... | null | CnkiDetail/my_tools/ip_test.py | ip_test.py | py | 3,605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "redis.ConnectionPool",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "redis.Redis",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "telnetlib.Telnet",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.compile",
"l... |
337058879 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('FeC0_theta102_01.log',
dtype=None,
comments='#',
delimiter='\t')
size = len(data)
datasize = 1024
campo = []
intensidad... | null | moke/medidas/FeC0/Angle analizer/promedios_1024.py | promedios_1024.py | py | 1,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.amin",
"line_nu... |
461123799 | import ROOT
from plots.common.sample_style import Styling
#Need to import ordereddict from python 2.7
try:
from collections import OrderedDict as dict
except ImportError:
from odict import OrderedDict as dict
def plot_hists_stacked(canv, hist_groups, **kwargs):
"""
***Mandatory arguments
canv ... | null | plots/common/stack_plot.py | stack_plot.py | py | 4,667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "odict.OrderedDict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "ROOT.THStack",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "tdrstyle.tdrstyle",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "ROOT.TH1F",
"lin... |
289443414 | # -*- coding: utf-8 -*-
###############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Saritha Sahadevan (<https://www.cybrosys.com>)
#
# This program is free software:... | null | import_product_image/models/import_image.py | import_image.py | py | 3,257 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "odoo.models.TransientModel",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Selection",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "odo... |
469363877 | #!/usr/bin/env python3
import rospy
import serial
import time
from serial import SerialException
from std_msgs.msg import Byte
from lg_common.helpers import run_with_influx_exception_handler
NODE_NAME = 'rfreceiver'
from lg_common.logger import get_logger
logger = get_logger(NODE_NAME)
def main():
buttondown_p... | null | lg_rfreceiver/scripts/sender.py | sender.py | py | 1,439 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lg_common.logger.get_logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "std_msgs.msg.Byte",
"line_number": 19,
"usage_type": "argument"
},
{
"api_name": "ros... |
35708069 | import os
import json
import numpy as np
import pandas as pd
from tqdm import tqdm
import requests
from sklearn.model_selection import train_test_split
import sklearn.preprocessing as preprocessing
def download_file(url, loc="data_files", blocksize=1000000):
if not os.path.exists(loc):
os.makedirs(loc)
... | null | geneselection/utils/data.py | data.py | py | 3,345 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.exists",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_numb... |
495225964 | import wx
import wx.adv
import time
from functools import reduce
from component.RecordBtn import RecordBtn
from component.DecodeTypeComboBox import DecodeTypeComboBox
from event import EVT_NEW_DATA
from utils import get_hex_str, get_str, get_complete_str, extract_byte
class TextOutputPanel(wx.Panel):
def __init_... | null | source/page/TextOutputPanel.py | TextOutputPanel.py | py | 5,193 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "wx.Panel",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "component.DecodeTypeComboBox.DecodeTypeComboBox",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "wx.CB_READONLY",
"line_number": 21,
"usage_type": "attribute"
},
{
... |
284670383 | # Webserver stuff
import tornado.ioloop
import tornado.web
import tornado.httpserver
from tornado.options import define, options
# Utility libraries
import os.path
import logging
from socket import gethostbyname, gethostname
# logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
# op... | null | Web_Visualization_Bundle/D3.js + DC.js ReportServer Dashboard/app.py | app.py | py | 2,274 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tornado.opti... |
468462044 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import login, authenticate
from django.contrib.auth.decorators import login_required, permission_required
from .models import Subject, News
from django.contrib.auth.models import User
from .forms import SubjectForm, NewsForm, Regi... | null | django/portal/views.py | views.py | py | 3,872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.RegisterForm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "... |
400384536 | from django.shortcuts import render
from django.http import HttpResponse
from pyodbc import IntegrityError
from django.contrib import auth
from django.http import *
from datetime import datetime
from reservation.models import *
from django.utils.datastructures import MultiValueDictKeyError
import random
import... | null | OVPR/reservation/views.py | views.py | py | 9,661 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 17,
"usage_type": "call"
},
{
"api_name"... |
332024444 | """ Mercy Healthcare subspider, built on top of PaginationList.
scrapy crawl -a extract=1 -a url="https://www.healthcaresource.com/mercyhealth"
sample url:
https://www.healthcarese.com/mercyhealth
"""
import re
from urlparse import urljoin
from scrapy.selector import Selector
from scrapy.http import FormRequest
from... | null | brightcorp/brightcorp/spiders/healthcaresource_ee_mercy.py | healthcaresource_ee_mercy.py | py | 3,603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "brightcorp.base.atsspider2.t... |
562530239 | #!/usr/bin/python3
# -*- coding:utf-8 -*-
from typing import List
class Solution:
def candy(self, ratings: List[int]) -> int:
n = len(ratings)
res = [1] * n
for i in range(1, n):
if ratings[i] > ratings[i - 1]:
res[i] = res[i - 1] + 1
for i in range(n - ... | null | 贪心算法/135.py | 135.py | py | 610 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
213229723 | '''
Title: Employee Recognition System
Authors: Sarah Cawley, Ryan Cosby, and Conrad Lewin
Oregon State University Capstone Course
Description: This is the main routing file used to handle all of the server side routing calls for our
employee recognition system. The application is used to deliver award recognition ema... | null | Capstone/main.py | main.py | py | 32,813 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "flask_cors.CORS",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_nu... |
27031046 | # -*- coding: utf-8 -*-
"""
train function
"""
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Reshape, Activation
from keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D
from keras.callbacks import ModelCheckpoint
# import custom function
... | null | train/train.py | train.py | py | 5,227 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.models.Sequential",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.layers.Conv2D",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras... |
456707553 | from copy import deepcopy
import os
import json
import pytest
import globus_sdk
from mdf_toolbox import toolbox
credentials = {
"app_name": "MDF_Forge",
"services": []
}
def test_login(capsys):
# Login works
creds1 = deepcopy(credentials)
creds1["services"] = ["search"]
res1 = toolbox.lo... | null | tests/test_toolbox.py | test_toolbox.py | py | 13,044 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "copy.deepcopy",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mdf_toolbox.toolbox.login",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "mdf_toolbox.toolbox",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "globus_sd... |
247364389 | import re
import itertools
from lxml.html import fromstring
import urllib.request
from urllib import robotparser
from urllib.parse import urljoin
from urllib.error import URLError, HTTPError, ContentTooShortError
from CsvCallback import CsvCallback
def download(url, user_agent='wswp', num_retries=2, charset='utf-8'):
... | null | Chapter02/CallbackLinkCrawler.py | CallbackLinkCrawler.py | py | 3,599 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib.request.request.Request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 12,
"usage_type": "name"
},
{
"api_nam... |
176044121 | """
Section for handling the raw ULTRACAM data and xml files
"""
from __future__ import absolute_import
from __future__ import print_function
import struct
import warnings
import xml.dom.minidom
from six.moves import zip
from six.moves import urllib
import six
try:
import numpy as np
except ImportError:
prin... | null | trm/ultracam/Raw.py | Raw.py | py | 81,398 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "trm.ultracam.Server.URL",
"line_number": 127,
"usage_type": "name"
},
{
"api_name": "trm.ultracam.UErrors.UltracamError",
"line_number": 128,
"usage_type": "call"
},
{
"api_name": "trm.ultracam.Server.URL",
"line_number": 131,
"usage_type": "name"
},
{
... |
350186102 | '''
Created on Jan 25, 2012
@author: Trung Dong Huynh
'''
import unittest
from prov.model import ProvBundle, ProvRecord, ProvExceptionCannotUnifyAttribute
import logging
import json
import examples
import os
logger = logging.getLogger(__name__)
class Test(unittest.TestCase):
def setUp(self):
... | null | prov/model/test/testModel.py | testModel.py | py | 5,770 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "examples.tests",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "examples... |
298840971 | # -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly
import plotly.express as px
from plotly.subplots import make_subplots
from support_funcs import * # this is bad Python style; don't do this normally
external_stylesheets = ['htt... | null | adv_data_viz/Midterm/problem_3/dash_app.py | dash_app.py | py | 1,303 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dash.Dash",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "dash_html_components.H1",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dash_html_... |
190589522 | import sys
import lldb
import traceback
import logging
import debugger
from ctypes import *
from value import Value
logging.basicConfig(level=logging.DEBUG, #filename='/tmp/codelldb.log',
format='%(levelname)s(Python) %(asctime)s %(name)s: %(message)s', datefmt='%H:%M:%S')
log = logging.getLogger(... | null | adapter2/codelldb.py | codelldb.py | py | 4,649 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.version_in... |
261049727 | from typing import List, Dict
import sys
import requests
import json
import time
from random import randint
url_history = 'http://medicalservice:5000/history'
patient_url = 'http://medicalservice:5000/patients'
# For testing outside a container:
#url = 'http://localhost:5000/history'
def add_patient(name, age, email... | null | client/client.py | client.py | py | 3,062 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.post",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.delete",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_num... |
551921731 | # _*_ coding: utf-8 _*_
'''操作所有的日志工作'''
import logging
from conf import settings
def logger(log_type):
logger = logging.getLogger(log_type)
logger.setLevel(settings.LOGIN_LEVEL)
#创建屏幕对象和设置等级debug
# ch = logging.StreamHandler()
# ch.setLevel(settings.LOGIN_LEVEL)
#创建文件对象,给文件对象设置等级
... | null | Basic_Knowledge/I2.shopping_market/atm/bin/logger.py | logger.py | py | 878 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "conf.settings.LOGIN_LEVEL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "conf.settings",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "conf.s... |
428639234 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 15 13:46:27 2021.
@author: quenot
"""
from pagailleIO import saveEdf,openImage,openSeq,save3D_Edf
from numpy.fft import fftshift as fftshift
from numpy.fft import ifftshift as ifftshift
from numpy.fft import fft2 as fft2
from numpy.fft import ifft2... | null | popcorn/phase_retrieval/MISTII_2.py | MISTII_2.py | py | 8,271 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.ones",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 42,
... |
303089188 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
import warnings
class Image:
def __init__(self, fname):
warnings.filterwarnings('ignore','The following header keyword is invalid or follows an unrecognized non-standard convention')
warnings.f... | null | image.py | image.py | py | 1,980 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.