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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
275410034 | from rest_framework import serializers
from wq.db.patterns.base.serializers import (
TypedAttachmentSerializer, AttachedModelSerializer
)
from wq.db.rest.serializers import ModelSerializer
import swapper
from wq.db.patterns.base.models import extract_nested_key
Event = swapper.load_model('vera', 'Event')
Paramete... | null | vera/serializers.py | serializers.py | py | 2,920 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "swapper.load_model",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "swapper.load_model",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "swapper.load... |
647467280 | # -*- coding: utf-8 -*-
# @Author : Yichen Lu
# @Email : eddielyc@163.com
# @File : experiment.py
# @Software: PyCharm
from alexmodel import AlexModel
from lbp_extractor import LbpExtractor
from dataset import get_dataloader
import utils
from sklearn.cluster import KMeans
from sklearn.decomposition im... | null | experiment.py | experiment.py | py | 3,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dataset.get_dataloader",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "alexmodel.AlexModel",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "dataset.get_dataloader",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "lbp... |
113524124 | """
- 日志收集器 logger:
- 2, 日志收集器级别 level
- 3, 日志处理器准备 handler
- 4, 日志处理器级别设置
- 5, 设置日志格式 format
- 6, 添加日志处理器
- 1、NOSET 0 等于没写,废话。
- 2,debug, 10, 调试,一些额外信息,备注,往往和主体功能无关。 日报里面的备注
- 3,info, 20 主体功能的信息。 日报,做了些啥?
- 4,warning, 30, 警告, 下次可能要出错了。 交警叔叔警告
- 5,error, 40, 犯错,违法。抢红灯
- 6, critical, 50, 极其严重。 抢银行
"""
impo... | null | keji/lesson15_配置文件/d02_logger格式.py | d02_logger格式.py | py | 1,334 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.FileHandler",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "logging.F... |
147937953 | # Copyright (C) 2020 University of Oxford
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | null | src/plugins/IRL_HSPC/fetcher.py | fetcher.py | py | 2,445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.fetcher.base_epidemiology.BaseEpidemiologyFetcher",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{... |
636161952 | from ctypes import *
import numpy
import matplotlib.pyplot as plt
from distpyinterface import *
eps=1
e1 = (eps)
e2 = (1.0)
e3 = (1.0)
#dp =_double(0.00027)
pia2 = numpy.pi*2
zero = 0
one = 1
num = 10000
betx=1
alfx= -0.50
bety=1
alfy= 0
momentum = c_double(6500000)
mass = c_double(938.0)
dist = cdll.LoadLibrary("./... | null | demo/example1.py | example1.py | py | 1,205 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.pi",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.sqrt",
"line_num... |
168311225 | # Copyright 2020 Zhejiang Lab. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | null | examples/knowledge_amalgamation/comprehensive_classification_scratch.py | comprehensive_classification_scratch.py | py | 5,655 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "kamal.vision.datasets.StanfordCars",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "kamal.vision.datasets",
"line_number": 32,
"usage_type": "attribute"
},
{
... |
87479161 | from typing import Optional
import rclpy
from rcl_interfaces.msg import ParameterDescriptor, SetParametersResult
from rclpy.lifecycle import Node
from rclpy.lifecycle import Publisher
from rclpy.lifecycle import State
from rclpy.lifecycle import TransitionCallbackReturn
from rclpy.timer import Timer
from suave.bluero... | null | suave/suave/spiral_search_lc.py | spiral_search_lc.py | py | 5,879 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.sqrt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "math.cos",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "math.sin",
"line_number": 26,
... |
612838593 | import requests
import re
import argparse
import sys
import os
import folium
import geoip2.database
# <--- Variables --->
dbl = ['https://panwdbl.appspot.com/lists/shdrop.txt',
'https://panwdbl.appspot.com/lists/shedrop.txt',
'https://panwdbl.appspot.com/lists/openbl.txt',
'https://panwdbl.appspo... | null | ipListchk.py | ipListchk.py | py | 3,223 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "geoip2.database.database.Reader",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "geoip2.database.database",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "geoip2.database",
"line_number": 28,
"usage_type": "name"
},
{
"api... |
373465344 | import json
import pandas as pd
import traitlets as T
from ..utils._py3k_compat import string_types
_attr_template = "Attribute not found: {0}. Valid keyword arguments for this class: {1}"
class BaseObject(T.HasTraits):
skip = []
def __init__(self, **kwargs):
all_traits = list(self.traits())
... | null | altair/schema/baseobject.py | baseobject.py | py | 7,110 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "traitlets.HasTraits",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "traitlets.Union",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "traitlets.Instance",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": ... |
97873386 | # Copyright 2016 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | null | moldesign/widgets/selection.py | selection.py | py | 8,345 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "moldesign.uibase.components.SelBase",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "moldesign.viewer.BondClicker",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "moldesign.viewer",
"line_number": 30,
"usage_type": "name"
},
{... |
307319665 | """Module implements the ModelWrangler object"""
import sys
import os
import logging
import json
import pickle
from multiprocessing import cpu_count
import numpy as np
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
LOGGER = logging.getLogger(__name__)
h = logging.StreamHandler(sys.stdout)
h.setF... | null | model_wrangler/model_wrangler.py | model_wrangler.py | py | 12,033 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
... |
231884482 | from openpyxl import workbook
from openpyxl import worksheet
from openpyxl import Workbook
from openpyxl import load_workbook
import os.path as op
import os
import csv
school_year = input(r'School Year:')
section = input(r'Section:')
directory = os.getcwd()
directory = directory + r'\\Sheets\\'
filetype... | null | StuGraDP/scripts/studadd.py | studadd.py | py | 1,462 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
155610719 | from config import args
import numpy as np
import tensorflow as tf
def layer_norm(inputs, epsilon=1e-8):
mean, variance = tf.nn.moments(inputs, [-1], keep_dims=True)
normalized = (inputs - mean) / (tf.sqrt(variance + epsilon))
params_shape = inputs.get_shape()[-1:]
gamma = tf.get_variable('gamma', p... | null | nlp-models/tensorflow/attn_is_all_u_need/modules.py | modules.py | py | 8,216 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tensorflow.nn.moments",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.nn",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.sqrt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_... |
562272679 | import logging; logger = logging.getLogger("morse." + __name__)
import morse.core.sensor
from morse.core import blenderapi
from morse.core.services import service, async_service
from morse.core import status
from morse.helpers.components import add_data, add_property
class Wheelspeed(morse.core.sensor.Sensor):
""... | null | install_stable/Vilma/src/Vilma/sensors/wheelspeed.py | wheelspeed.py | py | 2,662 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 1,
"usage_type": "call"
},
{
"api_name": "morse.core.sensor.core",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "morse.core.sensor",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "morse.he... |
6419585 | from flask import Flask, redirect, url_for
from flask import render_template, request, session
from datetime import timedelta
app = Flask(__name__)
app.secret_key = "zxvqw"
app.permanent_session_lifetime = timedelta(minutes = 5)
@app.route("/")
def home():
return render_template("index.html")
@app.ro... | null | app/app.py | app.py | py | 1,317 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.render_templ... |
547009245 | import logging
from common import errfunctions
from PyQt5.QtWidgets import QHBoxLayout
from database.database import PyDB, DBQueryModel
from database.dataquerier import DataQuerier
from widgets.dialogs import JDialog
from widgets.widgets import JTableView
class EprRunSelector(JDialog):
def __init__(self, parent... | null | epr/eprrunselector.py | eprrunselector.py | py | 1,273 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "widgets.dialogs.JDialog",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "database.database.PyDB.dbHandler",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "database.database.PyDB",
"line_number": 18,
"usage_type": "name"
},
{
... |
362418457 | """
.. hidden-code-block:: text
:label: View Licence Agreement <br>
sosw - Serverless Orchestrator of Serverless Workers
The MIT License (MIT)
Copyright (C) 2019 sosw core contributors <info@sosw.app>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this softw... | null | sosw/essential.py | essential.py | py | 2,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "sosw.app.Processor",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "sosw.component... |
191460228 | #import matplotlib.pyplot as plt
from abc import abstractmethod
from datetime import datetime
try:
from tensorflow import keras
except:
import keras
import numpy as np
from PIL import Image
import copy
import sys
import os
import cv2
def tp1(x):
print ('{:<80}'.format(x), end = '\r', flush = True)
def ctp1(x)... | null | src/utils.py | utils.py | py | 15,028 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.layers",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "keras.layers",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "keras.layers",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "keras.layers",
... |
639254978 | from PIL import Image
import os
import shutil
class IconResizer:
def resizeImg(self, file):
img = Image.open(file)
imgResized = img.resize((16, 16))
imgResized.save("16x" + file)
def organizePhoto(self, file):
if not os.path.exists("16px"):
os.makedirs("16px")
... | null | image-resizer.py | image-resizer.py | py | 750 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13... |
274062284 | import re
from typing import List
from spectacles.exceptions import SpectaclesException
def selector_to_pattern(selector: str) -> str:
try:
model, explore = selector.split("/")
assert model
assert explore
except (ValueError, AssertionError):
raise SpectaclesException(
... | null | spectacles/select.py | select.py | py | 1,239 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "spectacles.exceptions.SpectaclesException",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "re.match",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.mat... |
73341700 | from PyQt5 import QtCore, QtGui, QtWidgets
from OtherWindow1 import Ui_Dialog
from OtherWindow2 import Ui_Dialog1
# from OtherWindow1 import Ui_OtherWindow
class Ui_MainWindow(object):
def openWindow(self):
self.window = QtWidgets.QLabel()
self.ui = Ui_Dialog()
self.ui.setupUi(se... | null | MainWindow.py | MainWindow.py | py | 3,158 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QLabel",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "OtherWindow1.Ui_Dialog",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtW... |
196057639 | """Module for testing html_converter"""
import datetime
import io
import os
import unittest
from unittest.mock import patch, call
import html_converter
from single_article import SingleArticle
class TestArticlesHandler(unittest.TestCase):
"""Tests html_converter"""
def setUp(self) -> None:
self.artic... | null | final_task/rss_reader/tests/test_html_converter.py | test_html_converter.py | py | 4,686 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "single_article.SingleArticle",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "single_article.SingleArticle",
"line_number": 26,
"usage_type": "call"
},
{
"... |
144285801 | #!/usr/bin/env python3
"""A tool for generating a list for projectApprovedApis.yaml file.
Requirements in 'requirements.txt'.
"""
# Copyright 2020 Google LLC. This software is provided as-is, without warranty or representation
# for any use or purpose. Your use of it is subject to your agreement with Google.
import go... | null | scripts/generate-api-list.py | generate-api-list.py | py | 3,359 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "google.auth.auth.default",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": ... |
312998051 | from django import forms
from .models import QandaModel
class questionForm(forms.ModelForm):
class Meta:
model = QandaModel
fields = {
'question',
'answer',
'publish',
}
widgets = {
'question': forms.TextInput(attrs={
... | null | qanda/forms.py | forms.py | py | 652 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "models.QandaModel",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.forms.... |
404852247 | import gym
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from config import config
class Q_Network(nn.Module):
def __init__(self, name, state_dim, action_dim):
super(Q_Network, self).__init__()
self.name = name
self.fc1 = nn.Linear(state_dim, 128)
self.fc2 = n... | null | critic.py | critic.py | py | 2,846 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
121763182 | from PIL import Image, ImageDraw, ImageFont
import win32print
import threading
import win32api
import win32con
import win32gui
import os
import wx
def DefaultFont(size = 13, fg = 'SimHei'):
Font = wx.Font(size, wx.DEFAULT, wx.NORMAL, wx.NORMAL, faceName = fg)
return Font
class ConfigSet:
def _... | null | SecretaryWallpaper.py | SecretaryWallpaper.py | py | 21,127 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wx.Font",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wx.DEFAULT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "wx.NORMAL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "win32gui.GetDC",
"line_num... |
322911164 | #-------------------------------------------------------------------------------
# $Id$
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2013 EOX IT Services GmbH
#
# Per... | null | eoxserver/services/gdal/wcs/referenceable_dataset_renderer.py | referenceable_dataset_renderer.py | py | 10,305 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "eoxserver.core.Component",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "eoxserver.core.implements",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "eoxserver.services.ows.wcs.interfaces.WCSCoverageRendererInterface",
"line_number": 51,
... |
437717965 | '''
Given a Matrix containing 0s and 1s. Find the unit area of the largest region of 1s
Input : M[][5] = { 0 0 1 1 0
1 0 1 1 0
0 1 0 0 0
0 0 0 0 1 }
Output : 6
In the following example, there are
2 regions one with length 1 and the
other as 6. So largest regi... | null | geeksforgeeks/graph/21_Unit_Area_of_largest_region_of_1's.py | 21_Unit_Area_of_largest_region_of_1's.py | py | 1,738 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.deque",
"line_number": 43,
"usage_type": "call"
}
] |
473418357 | import cv2
import numpy as np
import os
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
recog = cv2.createLBPHFaceRecognizer()
vid = cv2.VideoCapture(0)
people={}
l = os.listdir('Faces/')
for i in l:
l1=i.split('.')
people[int(l1[1])]=l1[0]
recog.load('recog/recogniz... | null | face_pred.py | face_pred.py | py | 931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.CascadeClassifier",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.createLBPHFaceRecognizer",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.l... |
552340439 | '''
django urls
'''
from django.urls import path, include
from . import views
# from django.contrib.auth import views as auth_views
# from django.contrib import admin
app_name = 'inspectv1'
urlpatterns = [
# display home page
path('', views.IndexView.as_view(), name='index'),
path('add/', views.Add, name... | null | inspectv1/urls.py | urls.py | py | 1,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.urls.path",... |
375648796 | #!/usr/bin/python3
import requests
'''
tornlib.py
Author: Joshua Li
Description: A base library of functions that can interact with Torn's API.
'''
__API_KEY = '' # API key goes here.
'''
A general, core method for returning the appropriate JSON from a Torn API call.
Modes: 'user', 'property', 'faction', 'company'... | null | Torn City Utilities/tornlib.py | tornlib.py | py | 1,865 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
}
] |
525648413 | #!/usr/bin/env python3
#
# Use a SAX parser to efficiently read selected fields from XML.
import sys, xml.sax, re
base = sys.argv[1]
exact = []
prefix = []
class OCLCHandler(xml.sax.ContentHandler):
def __init__(self):
self.count = 0
self.content = ''
self.entry = {}
# If this is a new entry, clear ... | null | scripts/migrate.py | migrate.py | py | 2,067 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "xml.sax.sax",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "xml.sax",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 39,... |
612503148 | from json import loads
from urllib.request import urlopen
from time import sleep
friends_cities = []
your_id = "326049860"
your_city = urlopen("https://api.vk.com/method/users.get?user_id=" + your_id + "&v=5.52&fields=city")
your_city = your_city.read().decode("utf-8")
your_city = loads(your_city)
# print(your_city)
... | null | Pythonicus/l19/friends_city.py | friends_city.py | py | 884 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
483106856 | from django.core.cache import cache
from django.utils import timezone
from django.core.cache.utils import make_template_fragment_key
def invalidate_caches(name, param_list):
key = make_template_fragment_key(name, param_list)
cache.delete(key)
def replace_script_variables(some_string, appointment):
"""
... | null | core/utils.py | utils.py | py | 2,208 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.cache.utils.make_template_fragment_key",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache.delete",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.core.cache.cache",
"line_number": 8,
"usage_type":... |
259029146 | from django.contrib import admin
from .forms import *
from .models import Patient, PatientAppt, PermissionsRole, Doctor, PatientHealthConditions, TempPatientData, Alert, EMedication, LabTech, LabReport,LabTech,AddMedicalHistory
#Add custom columns to appear inside of the database for the user
class PatientApptAdmin(a... | null | IPIMS_Django_Source_Files/ipcms/ipcms/admin.py | admin.py | py | 1,717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 11,
"usage_type": "attribute"
... |
25750618 | '''
dfs 로 가장 큰 크기를 찾는다.
'''
from collections import deque
import sys
input = sys.stdin.readline
N,M,K = map(int,input().split())
Map = [[0]*(M+1) for j in range(N+1)]
dx = [0,0,1,-1]
dy = [1,-1,0,0]
for _ in range(K):
r,c = map(int,input().split())
Map[r][c] = 1
def ch_in(r,c):
if r == N+1 or c == M+1 o... | null | 백준/Python/카테고리/DFS/1743(음식물 피하기).py | 1743(음식물 피하기).py | py | 1,746 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 24,
"usage_type": "call"
}
] |
252012543 | import sys
from unittest import TestCase
from easyprocess import EasyProcess
from nose.tools import eq_
from path import Path
from pyvirtualdisplay.smartdisplay import DisplayTimeoutError, SmartDisplay
class Test(TestCase):
def test_disp(self):
vd = SmartDisplay().start()
# d = SmartDisplay(vis... | null | tests/test_smart.py | test_smart.py | py | 1,652 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pyvirtualdisplay.smartdisplay.SmartDisplay",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyvirtualdisplay.smartdisplay.SmartDisplay",
"line_number": 18,
"usage_type"... |
259142813 | import logging
import copy
import typing
import os
import json
import d3m.exceptions as exceptions
from dsbox.pipeline.fitted_pipeline import FittedPipeline
from dsbox.template.utils import score_prediction, calculate_score, SpecialMetric
from dsbox.schema import get_target_columns, larger_is_better
from d3m.metadata.... | null | python/dsbox/pipeline/ensemble_tuning.py | ensemble_tuning.py | py | 29,878 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "d3m.container.Dataset",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "d3m.container",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "d3m.container.Dataset",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "d... |
92017339 | from scrapy import Spider
from scrapy.http import Request
from scrapy.selector import Selector
from scrapy.log import logger
from scrapy.spiders import CrawlSpider
'''
琪琪主页
http://m.77kp.com/
'''
class HomeSprider(Spider):
name = "home_spider"
start_urls = ["http://m.77kp.com"]
def parse(self, response)... | null | QiQi/spiders/home_spider.py | home_spider.py | py | 2,030 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "scrapy.log.logger.info",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scrapy.log.logger",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "scrapy.log.log... |
360830577 | '''
Created on 11/11/2014
@author 仇之东
'''
import base64
import datetime
# 提取path中<ol class="breadcrumb"下面<li></li>中的数据,并整理
def gen_breadcrumb(path):
length = len(path)
breadcrumb = '<ol class="breadcrumb">\n'
for item in range(length):
key = path[item][0]
value = path[item][1]
breadcrumb +... | null | dura/utils.py | utils.py | py | 2,259 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "base64.encodestring",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "date... |
368620054 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | null | mindspore/ops/operations/_inner_ops.py | _inner_ops.py | py | 14,847 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "primitive.PrimitiveWithInfer",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "_checkparam.Validator.check_value_type",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "_checkparam.Validator",
"line_number": 56,
"usage_type": "name"
},
... |
459512609 | # coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import traceback
from celery import shared_task
from celery.utils.log import get_task_logger
from .models import Execution
logger = get_task_logger("operation_manager")
@shared_task
def check_operations_periodically():
# ... | null | omapp/tasks.py | tasks.py | py | 1,877 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "celery.utils.log.get_task_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Execution.objects.filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "models.Execution.objects",
"line_number": 17,
"usage_type": "attribute"
... |
463099069 | import time
from optparse import OptionParser
import yaml
import json
import logging
import sys
import redis
import numpy as np
import string
from meerkat_backend_interface import redis_tools
from meerkat_backend_interface.logger import log, set_logger
# Redis channels to listen to
ALERTS_CHANNEL = redis_tools.REDIS_C... | null | meerkat_backend_interface/coordinator.py | coordinator.py | py | 41,319 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "meerkat_backend_interface.redis_tools.REDIS_CHANNELS",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "meerkat_backend_interface.redis_tools",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "meerkat_backend_interface.redis_tools.REDIS_CHANN... |
540192556 | from lxml import etree
from .expression import Expression
from ..exception import InconsistentDataException
from typing import List
from rfc2xml.elements import Element
from protocol import Expression as ProtocolExpression, MethodInvocationExpression, FieldAccessExpression,\
ArgumentExpression, ThisExpression, Cons... | null | src/input_parsers/extended_diagrams/elements/field.py | field.py | py | 5,430 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rfc2xml.elements.Element",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "lxml.etree.Element",... |
240728910 | # Ivy Tech - SDEV 140 - Introduction to Software Development
# Chapter 2 Exercise 6. Sales Tax
# Andrew M. Pierce Associate of Applied Science - Software Development
# Python 3.9.0
# logging for exceptions / sys for quit / time for sleep
import logging
import sys
import time
# Handles all user input, expects numeric... | null | Chapter 002 Exercises/PierceAndrewM01_Ch2Ex6.py | PierceAndrewM01_Ch2Ex6.py | py | 2,213 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.exception",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 3... |
71188329 | from sqlalchemy import orm, Column, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from pynYNAB.schema import BaseModel, DictDiffer
class RootEntity(BaseModel):
previous_map = {}
def _get_changed(self, fn):
changed_entities = self.get_changed_... | null | pynYNAB/schema/RootEntity.py | RootEntity.py | py | 2,733 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pynYNAB.schema.BaseModel",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pynYNAB.schema.DictDiffer",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.reconstructor",
"line_number": 58,
"usage_type": "attribute"
},
{
... |
276813250 | import math
import numpy as np
from scipy.special import gammaln
"""
Functions below compare "ref" and "sim" columns of a pandas.DataFrame
"""
def dirichlet_multinomial_pandas(df):
# Get the number of total observations aggregated over the last level in MultiIndex
# e.g. if levels are ['Channel', 'Season'... | null | calibtool/LL_calculators.py | LL_calculators.py | py | 5,546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.special.gammaln",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.special.gammaln",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.special.gammaln",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sci... |
14444992 | # -*- coding: utf-8 -*-
"""Factory classes for easily generating test objects."""
import random
import datetime
import factory
from h.api import storage
from h.accounts import models as accounts_models
class Annotation(factory.Factory):
"""A factory class that generates test annotation dicts.
Usage:
... | null | h/test/factories.py | factories.py | py | 4,806 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "factory.Factory",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "h.api.storage.annotation_from_dict",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "h.api.storage",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": ... |
283082174 | import requests
from decouple import config
token = config('TELE_TOKEN')
api_url = f'https://api.telegram.org/bot{token}'
# flask_url = f'https://b109ae8c.ngrok.io/{token}'
flask_url = f'https://haedal.pythonanywhere.com/{token}'
set_url = f'{api_url}/setWebhook?url={flask_url}'
response = requests.get(set_url)
prin... | null | bot/set_webhook.py | set_webhook.py | py | 337 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "decouple.config",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 10,
"usage_type": "call"
}
] |
53215997 | '''Testing pymica.clustered_regression.py
'''
import json
import unittest
from pymica.clustered_regression import ClusteredRegression
class TestClusteredRegression(unittest.TestCase):
def test_regression_ideal_data(self):
f_p = open("./test/data/sample_data.json")
data = json.load(f_p)
f_... | null | test/clustered_regression_test.py | clustered_regression_test.py | py | 2,337 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymica.clustered_regression.ClusteredRegression",
"line_number": 14,
"usage_type": "call"
},
{
"a... |
300413973 | from __future__ import absolute_import, division, print_function
import logging
import operator
import warnings
import numpy as np
import pandas as pd
from glue.core.subset import (RoiSubsetState, RangeSubsetState,
CategoricalROISubsetState, AndState,
Categ... | null | glue/core/component.py | component.py | py | 20,118 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.ndarray",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "glue.utils.coerce_numeric",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "numpy.can_... |
407326788 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import sys, os, math
import re
from collections import defaultdict
import sys
import MeCab
import io,sys
import recipeDB
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
def create_page(rank, inf, materials):
header = '''
<html>
<head>
... | null | demo_system/cgi-executables/makeRecipePage.py | makeRecipePage.py | py | 9,482 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.stdout",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "io.TextIOWrapper",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "MeCab.Tagger",
"line_number": 179,
"usage_type": "call"
},
{
"api_name": "recipeDB.recipeDB",
... |
548449923 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: J. Massey
@description: Load data from files to numpy
@contact: jmom1n15@soton.ac.uk
"""
import numpy as np
import os
import postproc.boundary_layer
from tqdm import tqdm
import _pickle as cPickle
from sklearn.preprocessing import PolynomialFeatures
def mu_... | null | circular_cylinder/Train/figures/load_raw.py | load_raw.py | py | 4,805 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.empty",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": ... |
348434242 | from openpyxl import *
import csv
import xlrd
import re
list = []
def write(filename,sh):
if sh==3:
stats = 'Disabled workers'
elif sh==4:
stats = 'Ethnic diversity'
elif sh==5:
stats = 'Part time work'
elif sh==6:
stats = 'Gender'
elif sh==7:
stats = 'Sel... | null | src/python_scripts/blueprint3type.py | blueprint3type.py | py | 1,660 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlrd.open_workbook",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "re.search",
"lin... |
48138025 | import numpy as np
import pandas as pd
from keras.callbacks import EarlyStopping
from pathlib import Path
import os.path
import os
import matplotlib.pyplot as plt
import seaborn as sns
from tensorflow.keras.models import Model
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.... | null | MobileNet.py | MobileNet.py | py | 4,335 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_numbe... |
599155968 | # -*- coding: utf-8 -*-
"""
Author : Mark Dziwirek
Last Update : 2017-10-30
Version : 1.00
"""
from bs4 import BeautifulSoup
import urllib2
import time
stock_symbol = raw_input('Please enter a stock symbol example AAPL : ')
url = 'http://finance.yahoo.com/quote/{s}/history?ltr=1... | null | apple_stock.py | apple_stock.py | py | 784 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib2.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
}
] |
384415200 | import asyncio
from bleak import BleakClient
# 위에서 얻은 BLE 장치의 주소
# address = "8c:aa:b5:84:db:52"
address ="C4:61:51:AF:3C:E7"
# 장치와 연결해제시 발생하는 콜백 이벤트
def on_disconnect(client):
print("Client with address {} got disconnected!".format(client.address))
async def run(address):
# 장치 주소를 이용해 client 클래스 생성
clie... | null | brconnect.py | brconnect.py | py | 937 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bleak.BleakClient",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 29,
"usage_type": "call"
}
] |
92488073 | import concurrent.futures
import multiprocessing as mp
import time
import random
def merge_sort (a) :
if len(a) < 2:
return a
# De lo contrario, se divide en 2
else:
middle = len(a) // 2
right = merge_sort(a[:middle])
left = merge_sort(a[middle:])
return mer... | null | mergesort.py | mergesort.py | py | 2,074 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.RawArray",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "random.ran... |
355442069 | import pandas as pd
import numpy as np
from compare_pos_tag import sampling_by_length,preprocessing
from konlpy.tag import Okt
import ast
import pickle
import argparse
#doc id 만드는 함수 : ex_ ('서문경 교수','간호학 개론'):0 (0번 부터 시작)
class doc2vec_pre:
def __init__(self,doc_id):
self.doc_i... | null | embedding_re/preprocessing/pre_doc.py | pre_doc.py | py | 1,188 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 46,
"usage_type": "call"
}
] |
38353944 | import openpyxl, csv
import re
import os
def cleanse_csv_file(load_filename, save_filename):
saved_row = None
row_to_append = None
count = 0
previous_b = ""
append_row = False
finished = False
review_status = -1
with open(load_filename + ".csv", 'r', encoding="utf8") as csv_file:
... | null | RegexNLP-py/datahandler/cleanse_data.py | cleanse_data.py | py | 3,766 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "csv.reader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 35,
... |
138911021 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script runs neogeo from an HDF5 formatted dataset, varies the numbers
of features loaded from the database and number of features searched per
image in order to make some meaningful results for the journal article
"""
# import sys
import bcolz
import pnpnav.utils a... | null | PFILT/FMOTF.py | FMOTF.py | py | 9,531 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.hstack",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.argsort",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "progressive.tree.Value",
... |
612016261 | #!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
###############################################################################
# Airparticulates.py #
# (c) https://github.com/thomaspfeiffer-git/raspberry, 2018 #
##################################... | null | airparticulates/Airparticulates.py | Airparticulates.py | py | 5,403 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.... |
239026877 | from PyQt5 import QtCore
from pyqtgraph import PlotWidget
import pyqtgraph as pg
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QGridLayout, \
QPushButton, QLineEdit, QLabel
import sys
operators = {'+': (1, lambda x, y: x + y), '-': (1, lambda x, y: x - y),
'*': (2, lambda x, y: x * ... | null | PyQtGraph/graph.py | graph.py | py | 5,249 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtCore.Qt",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtCore",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtCor... |
534765939 |
import parso
class CGenerator:
def __init__(self, module):
self.module = module
self.visit(self.module)
def visit(self, node):
"""Visit a node."""
print('visit:', node)
method = 'visit_' + node.__class__.__name__
visitor = getattr(self, method, self.generic_vis... | null | markpy/compiler/cgenerator.py | cgenerator.py | py | 896 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "parso.tree",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "parso.tree",
"line_number": 28,
"usage_type": "attribute"
}
] |
639083132 | from rest_framework import serializers
from room.models import Room, UserJoin, Dot
class ActiveRoomSerializer(serializers.ModelSerializer):
user_played = serializers.IntegerField(read_only=True)
def validate(self, attrs):
validated_data = super().validate(attrs)
validated_data['creator'] = s... | null | room/serializers.py | serializers.py | py | 2,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.IntegerField",
"line_number": 7,
"usa... |
114470561 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# Logotheras Copyright (C) 2012 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of Logotheras.
# Logotheras is free software: you can redistribute it and/or... | null | logotheras/system/logger.py | logger.py | py | 6,177 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.path.exists",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 88,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 88,
"usage_type": "name"
},
{
"api_name": "logotheras.errors.error... |
463811432 | import matplotlib.pyplot as plt
import os
import pandas as pd
from ssa_core import ssa, ssa_predict, ssaview, inv_ssa, ssa_cutoff_order
import numpy as np
import config
from offline import get_files
def mape(f, t):
return 100*((f - t)/t).abs().sum()/len(t)
def mae(f, t):
return 100*(f - t).abs().sum()/len... | null | main.py | main.py | py | 2,645 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "offline.get_files",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
622625434 | from matplotlib import pylab as plt
from attention import attention
import math
import scipy.io as sio
import numpy as np
import tensorflow as tf
import random
import logging
logging.getLogger("tensorflow").setLevel(logging.WARNING) #DEBUG, INFO, WARNING, ERROR
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "... | null | LW_AER_CData.py | LW_AER_CData.py | py | 18,606 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.WARNING",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.add",... |
542365700 | import logging
import clamd
import sys
from django.core.exceptions import ValidationError
from django.conf import settings
logger = logging.getLogger(__name__)
def file_scan_validation(file):
"""
This validator sends the file to ClamAV for scanning and returns returns to the form. By default, if antivirus
... | null | edivorce/apps/core/validators.py | validators.py | py | 1,558 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.CLAMAV_ENABLED",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 23,
"usage_type": "name"
},
{
"ap... |
619835928 | import sys
import os
from cx_Freeze import setup, Executable
os.environ["TCL_LIBRARY"] = "C:\\Anaconda3\\tcl\\tcl8.6"
os.environ["TK_LIBRARY"] = "C:\\Anaconda3\\tcl\\tk8.6"
base = None
if sys.platform == 'win32':
base = "Win32GUI"
executables = [Executable("wc.py", base=base)]
setup( name = "Woochang O... | null | setup____.py | setup____.py | py | 464 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.platform",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cx_Freeze.Executable"... |
392688759 | import utils
import Model.AlexNet as AlexNet
class alex_hparam():
def __init__(self):
self.dataset = "cifar10"
self.batch_size = 128
self.epoch_num = 100
self.drop_rate = 0.5
self.learning_rate=0.001
self.learning_decay_rate=0.1
self.learning_dec... | null | alex_main.py | alex_main.py | py | 969 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "Model.AlexNet.AlexNet",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "Model.AlexNet",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "utils.train",
"line_number": 31,
"usage_type": "call"
}
] |
308077285 | """This module provides TransmartHandler, an implementation of ETLHandler for
tranSMART."""
import logging
from typing import Dict
import jwt
import requests
from fractalis import app
from fractalis.data.etlhandler import ETLHandler
from fractalis.data_services_config import Handler
logger = logging.getLogger(__nam... | null | fractalis/data/etls/transmart/handler_transmart.py | handler_transmart.py | py | 4,389 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fractalis.data.etlhandler.ETLHandler",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "fractalis.data_services_config.Handler.TRANSMART",
"line_number": 28,
"usage_type"... |
430603861 | import logging
import re
import fnmatch
import os
import os.path
import re
import argparse
def parse_args(arg_input=None):
parser = argparse.ArgumentParser(description='Get OS Albums.')
parser.add_argument('--top_dir', metavar='top_dir', dest='top_dir',
help='root photo directory.',
... | null | get_jpg_dirs.py | get_jpg_dirs.py | py | 2,497 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.walk... |
21062372 | from app.module import Module
from app import response
from flask import request, send_file
from db.recipes import Recipe
from db.image import append_image, random_image_path
module = Module('recipes', icon = 'r')
@module.bp.context_processor
def inject_data():
return dict(
MODULE=module.bp.name
)
... | null | app/routes/recipes/__init__.py | __init__.py | py | 1,693 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.module.Module",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "db.recipes.Recipe.cursor",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "db.recipes.Recipe",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "db.recipe... |
119112535 | import hashlib
import requests
from bs4 import BeautifulSoup
url = 'https://www.theonion.com/latest'
print("Grabbed url")
links = []
website = requests.get(url)
website_text = website.text
soup = BeautifulSoup(website_text, features="lxml")
for link in soup.find_all('a'):
links.append(link.get('href')... | null | scraper.py | scraper.py | py | 2,022 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 69,
"usage_type": "call"
}
] |
555763700 | from itertools import chain
import torch
from RL.utils import nn_from_layout, discounted_rewards
from configuration.layout_configuration import LayoutConfiguration
from utilities import Buffer
from .agent import Agent
test_input = torch.tensor([1], dtype=torch.float, device='cuda')
discounting = 0.99
class A2CAge... | null | python/src/RL/agents/a2c_agent_two_headed.py | a2c_agent_two_headed.py | py | 2,012 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.tensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.float",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "agent.Agent",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "configuration.layout_config... |
92945329 | import math
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
rM0 = 4.60 # Initial radius of Mercury orbit, in units of R0
vM0 = 5.10e-1 # Initial orbital speed of Mercury, in units of R0/T0
c_a = 9.90e-1 # Base acceleration of Mercury, in units of R0**... | null | planet.py | planet.py | py | 2,264 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.dot",
"line_number": 25,
... |
605794638 | import requests
import http.cookiejar as cookielib
import configparser
from bs4 import BeautifulSoup
import sys
import redis
import json
import math
import pymysql
import traceback
import threading
import time
import random
import os
import urllib3
from bs4 import BeautifulSoup
import http.client
import pymysql
pymysql... | null | python/ZhihuSpider/firstPython.py | firstPython.py | py | 5,731 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.install_as_MySQLdb",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "os.pat... |
408263653 | import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
# %matplotlib inline
import matplotlib.pyplot as plt
import tempfile
logdir = tempfile.mkdtemp()
b = tf.Variable(tf.zeros((100,)))
W = tf.Variable(tf.random_uniform((784, 100),
-1, 1))
x = tf.placeholder(tf.float32... | null | sample_tf.py | sample_tf.py | py | 3,998 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tempfile.mkdtemp",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "tensorflow.Variable",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.Varia... |
252356666 | from transformers.data.processors.glue import Sst2Processor
from transformers.data.processors.glue import InputExample
import csv
import os
import sys
class CsvSst2Processor(Sst2Processor):
def get_train_examples(self, data_dir):
"""See base class."""
return self._csv_create_examples(
s... | null | model/csv_processor.py | csv_processor.py | py | 2,162 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "transformers.data.processors.glue.Sst2Processor",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name... |
521964695 | from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('mysql://snacks:snacks@localhost/snacks',convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=False,
autoflush=Fals... | null | snacks/database.py | database.py | py | 767 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.scoped_session",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 6,
"usage_type": "call"
},
{
"a... |
490456523 | import curses
from statusbar import StatusBar
import logging
class ExTerm(object):
def __init__(self):
self.x = 0
self.y = 0
self.modes = []
self.current_mode = None
self.stdscr = None
self.statusbar = StatusBar('')
def show(self):
curses.wrapper(self.s... | null | exterm/term.py | term.py | py | 1,996 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "statusbar.StatusBar",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "curses.wrapper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "curses.start_color",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "curses.init_pai... |
197784326 | #!/usr/bin/env python3
#!/usr/bin/python
import sys
import yaml
VT100_BOLD = "[0;1m"
VT100_RED = "[0;1;31m"
VT100_GREEN = "[0;1;32m"
VT100_STOP_MARKUP = "[0m"
def list1():
print("\n---------------------------------------------------------------------------------")
print("list1")
l1 = []
l1.append... | null | python3/yaml/dl1.py | dl1.py | py | 5,072 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.dump",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
"line_number... |
555407382 | import pygame, random, sys
from pygame import *
from random import *
from pygame.locals import *
pygame.init()
# Variable declarations
SIZE = 300, 300
WINDOW = pygame.display.set_mode(SIZE)
WHITE = (255, 255, 255)
PINK = (255, 174, 185)
BLACK = (0, 0, 0)
mx = 0
my = 0
COLOR = PINK
COINS = 4
OFFSET = 50
START_POS = []
... | null | FLIP_HARD/flip.py | flip.py | py | 4,399 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.s... |
401052027 | # Documentation:
# * https://github.com/gfairchild/yelpapi
# * https://github.com/gfairchild/yelpapi/blob/master/examples/examples.py
# pip install yelpapi
from yelpapi import YelpAPI
from urllib.request import urlopen
import helpers
import json
def get_yelp_key():
# Handles security:
url = 'https://eecs110-... | null | course-files/projects/project_02/option2_data_display/samples/yelp/06_yelp_comments.py | 06_yelp_comments.py | py | 757 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "helpers.get_file_path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
... |
207045366 | import sqlite3
import tempfile
import unittest
from shortest_path import Graph1, all_shortest_paths, all_related_actors
def test_shortest_path_1():
"""Shortest path encounters a path to actor-2 (17) then finds an
alternative route that is shorter."""
fd, db_filename = tempfile.mkstemp()
conn = sqlite... | null | src/test/shortest_path_test.py | shortest_path_test.py | py | 836 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tempfile.mkstemp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "shortest_path.Graph1",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "shortest_path.a... |
546633785 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 8 09:53:33 2018
@author: lfabbrini
"""
import sys
print (sys.version) #parentheses necessary in python 3.
#print (sys.path)
import keras
print (keras.__version__)
import matplotlib.pyplot as plt
import numpy as np
import os
#import re
from tim... | null | png/02_train_with_test_and_train_idsBT.py | 02_train_with_test_and_train_idsBT.py | py | 7,400 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.version",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "keras.__version__",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"li... |
325836859 | # -*- coding: utf-8 -*-
# @Time : 2019/9/4 16:25
# @File : test_recharge.py
# @Software: PyCharm
#@author:liu
import decimal
import unittest
import os
from pack_lib.ddt import ddt,data
from common.Read_Excel import ReadExcel
from common.http_requests import HTTPSession
from common.my_logging import log
from commo... | null | api_project/testcases/test_withdraw.py | test_withdraw.py | py | 2,319 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "common.Read_Excel.ReadExcel",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "commo... |
637236134 | """
Train an agent using a PPO2 based on OpenAI Baselines.
"""
import time
from mpi4py import MPI
import tensorflow as tf
import wandb
from baselines.common import set_global_seeds
import coinrun.main_utils as utils
from coinrun import setup_utils, policies_back, wrappers, ppo2, ppo2_nr
from coinrun.config import Confi... | null | coinrun/train_agent.py | train_agent.py | py | 2,414 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "coinrun.config.Config.USE_LSTM",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "coinrun.config.Config",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "coinrun.ppo2_nr.learn",
"line_number": 15,
"usage_type": "call"
},
{
"a... |
635339591 | #3부<문제>19번-연산자 끼워 넣기
#itertools를 이용한 풀이
from itertools import permutations
n=int(input())
data = list(map(int,input().split()))
add,sub,mul,div = map(int,input().split())
a='+'*add + '-'*sub + '*'*mul + '/'*div
a=list(set(permutations(a,n-1)))
min_value = 1e9
max_value = -1e9
def calc ():
global min_value
... | null | thisis_coding_test/thisis_dfs_bfs_19_2.py | thisis_dfs_bfs_19_2.py | py | 851 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.permutations",
"line_number": 11,
"usage_type": "call"
}
] |
94631069 | from flask import Flask, request, render_template, redirect, url_for
from config import DevelopmentConfig
from models import db, Position, Department, Director, Employee, Vacancy, EmployeeHistory
from forms import PositionForm, DepartmentForm, VacancyForm, EmployeeForm, TransferForm
app = Flask(__name__)
app.config.fr... | null | app.py | app.py | py | 10,328 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.DevelopmentConfig",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "models.db.init_app",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "models.db",
... |
311445735 | import numpy as np
from astropy.time.sofa_time import iau_gd2gc
import manage as man
import sys
#a program containing functions that convert lists of coordinates from geodetic to geocentric or vice versa.
cos=np.cos
sin=np.sin
atan=np.arctan
atan2=np.arctan2
def km(values):
newlist=[]
for i in range(len(valu... | null | Code/telescope_gc_coords.py | telescope_gc_coords.py | py | 3,754 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.cos",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.arctan",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.arctan2",
"li... |
239744727 | import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Actor(nn.Module):
def __init__(self, state_dim, action_dim, max_action):
super(Actor, self).__init__()
self.l1 = nn.Linear(state_dim, 256... | null | StateVectorBC.py | StateVectorBC.py | py | 2,107 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
338058472 | import pdb
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from data.my_dataset import MyDataset
from torch.utils.data import DataLoader
import torch.optim as optim
def test_train_function():
"""
Test the ability of the 'train' function to train a simple network (1 epoch).
"""
... | null | Neural_Networks/tests/test_run_model.py | test_run_model.py | py | 3,717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "data.my_dataset.MyDataset",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Da... |
416530828 | # -*- coding: utf-8 -*-
"""
Created on Tue May 4 20:12:31 2021
@author: Alish Chelackal
"""
import pandas as pd
import networkx as nx
nodes=pd.read_excel('C:/Users/Alish Chelackal/Desktop/roche/raan_case_study interns.xlsx',sheet_name='nodes')
edge=pd.read_excel('C:/Users/Alish Chelackal/Desktop/roche/raan_case_stud... | null | code.py | code.py | py | 852 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_excel",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "networkx.from_pandas_edgelist",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "net... |
433749567 | """
Based on https://github.com/NVlabs/SPADE
Original copyright:
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import os
import time
import numpy as np
import logging
from util.util import n... | null | util/iter_counter.py | iter_counter.py | py | 4,418 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line... |
230062246 | import numpy as np
import matplotlib.pyplot as plt
import sklearn
import sklearn.datasets
from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation
from init_utils import update_parameters, predict, load_dataset, predict_dec
from dlFramework import frame as fw
from num2.planar... | null | test3.py | test3.py | py | 1,345 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
558556120 | from flask import Flask
from flask import request
import json
import process_query as pq
from flask_cors import CORS
# larger_nlp = spacy.load('en_core_web_lg')
app = Flask(__name__)
CORS(app)
@app.route('/fetchdata')
def fetchdata():
query = request.args.get('query')
sentiment = request.args.get('sentiment'... | null | app.py | app.py | py | 557 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.args",... |
499923550 | from random import randint, sample, choice
from multiprocessing import Process, Queue
from tqdm import tqdm
import h5py
import numpy as np
import time
import signal
QUEUE_SIZE = 32
NUM_PROCESSES = 48
class ParallelTrainingDataGenerator:
def __init__(self, batch_size=100, segment_size=40, spectrogram... | null | networks/pairwise_lstm/core/parallel_train_data_gen.py | parallel_train_data_gen.py | py | 4,544 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "signal.signal",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "signal.SIGTERM",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "signal.signal",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "signal.SIGINT",
"... |
461762172 | #!/usr/bin/env python3.2
from datetime import datetime
from lxml import objectify
import argparse
import configparser
import glob
import os
import re
import shlex
import math
import shutil
import subprocess
import sys
import time
import atexit
DATE_PREFIX_FORMAT = "%x %H:%M / "
DATE_PREFIX_SPACE = " "... | null | pytv/pytv.py | pytv.py | py | 10,286 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "math.floor",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stdout.write",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.