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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
170645493 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from selenium import webdriver
from movies.items import MoviesItem
class DoubanSpider(scrapy.Spider):
name = 'douban'
allowed_domains = ['douban.com']
start_urls = ['http://douban.com/']
# def parse(self, response):
# p... | null | week06/movies/movies/spiders/douban.py | douban.py | py | 1,016 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "movies.items",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "scrapy.selector.Selecto... |
265402949 | #!/usr/bin/env python3
import asyncio
import os
import fcntl
import sys
def read_file(fp, buf_s=65535):
res = None
while res is None:
res = fp.read(buf_s)
yield
return res
def _print():
for i in range(10):
print(i)
yield
def read_coro(fp, buf_s=65535):
flg = fcn... | null | test/test.py | test.py | py | 784 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "fcntl.fcntl",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fcntl.F_GETFL",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "fcntl.fcntl",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "fcntl.F_SETFL",
"line_... |
116299672 | from faces import *
from model import *
from download_image import *
import os
import keyboard
import numpy as np
import cv2
CAMERA_PATH = os.path.dirname(__file__) + '\\images\\camera'
# training từ thư mục
def item_training_from_folder():
print("""
***********************************************
... | null | main.py | main.py | py | 8,364 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
342285410 | import scipy.io
from tqdm import tqdm
import pickle
import numpy as np
import sys
import math
from scipy.linalg import lstsq
from sklearn.model_selection import KFold
import argparse
# get initial information from MATLAB
def get_activations(info):
print("getting activations...")
mat = scipy.io.loadmat(info)
activa... | null | odyssey_decoding.py | odyssey_decoding.py | py | 6,166 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scipy.io.io.loadmat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scipy.io.io",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "scipy.io",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pickle.dump",
"line... |
345126492 | import pygame, random
import entidades
class Zumbie(entidades.Entidade):
def __init__(self, x, y, largura, altura, cor, fisica):
entidades.Entidade.__init__(self, x, y, largura, altura, cor, fisica)
#Atributos
self.velocidadeAndar = random.randint(2, 6)/10.0
self.campoVisao = 300
def desenharChunk... | null | zumbies.py | zumbies.py | py | 945 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "entidades.Entidade",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "entidades.Entidade.__init__",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "entidades.Entidade",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name... |
484341404 | #!/global/home/users/ryee/miniconda/envs/myenv3/bin/python
from glob import glob
import os
from itertools import (islice, zip_longest)
from collections import Counter
from sys import argv
import time, datetime
import argparse
import re
import pytz, arrow
import numpy as np
import tables as tb
#import raw_taq
from ... | null | ry/symbol_count/count_symbols_using_taq.py | count_symbols_using_taq.py | py | 4,420 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "taq.raw_taq.TAQ2Chunks",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "taq.raw_t... |
180790261 | import re
import datetime
import time
import csv
import difflib
import json
import logging
import player_resolution.find_player as find_player
import resolve
from config import config
from config import constants
import playbyplay_espn_v2016
LOGDIR_CLEAN = constants.LOGDIR_CLEAN
LOGDIR_EXTRACT = constants.LOGDIR_E... | null | clean/playbyplay_espn_ncaam_v2016.py | playbyplay_espn_ncaam_v2016.py | py | 1,575 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "config.constants.LOGDIR_CLEAN",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "config.constants",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "config.constants.LOGDIR_EXTRACT",
"line_number": 18,
"usage_type": "attribute"
},
... |
503829363 | #licence MIT
import numpy as np
import pandas as pd
def random_indexes(arr, rate = 0.1):
index_of_arr = np.arange(len(arr))
np.random.shuffle(index_of_arr)
return index_of_arr[0:int(len(arr)*rate)]
def random_nan(arr, rate = 0.1):
index_to_nan = random_indexes(arr, rate)
if arr.dtype == np.int:... | null | data_generator.py | data_generator.py | py | 3,171 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.int",
"lin... |
316893360 | # ideal case where all the sample are made from a perfect template and everything is readable properly
# for the good sample given
import csv
from PIL import Image, ImageDraw, ImageFont
import pytesseract
import nltk
import re
import numpy as np
pytesseract.pytesseract.tesseract_cmd = r"C:\\Program Files\\Tesseract-O... | null | DocRecognitionAndDataRetrieval.py | DocRecognitionAndDataRetrieval.py | py | 7,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "nltk.bigrams",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open"... |
595128097 | #!/usr/local/bin/python3
import os
import requests
import gitlab
import downloadComponet
import sys
sys.path.append("./")
import config
from lint import diff
import json
def cleanWorkspace(workspacePath):
os.chdir(workspacePath)
directionarys = os.listdir(workspacePath)
for dir in directionarys:
if ... | null | batchGit/batchGit.py | batchGit.py | py | 11,006 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
532589482 | import time
import pygame
from herding import Herding
#from herding.data.configuration import get_default_configuration
import argparse
import sys
import numpy as np
from pygame.locals import (
K_UP,
K_DOWN,
K_LEFT,
K_RIGHT,
K_ESCAPE,
K_r,
KEYDOWN,
KEYUP,
QUIT,
)
class ManualStee... | null | utils/manual_steering.py | manual_steering.py | py | 2,836 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.locals.K_UP",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pygame.locals.K_LEFT",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "pygame.locals.K_RIGHT",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "pygame.... |
577672153 | import re
from collections import namedtuple
from lxml import etree as ET
# XML Namespaces for ElementTree
NS = {
"ops": "http://ops.epo.org",
"epo": "http://www.epo.org/exchange",
"ft": "http://www.epo.org/fulltext",
"reg": "http://www.epo.org/register",
}
DocDB = namedtuple("DocDB", ["country", "num... | null | src/patent_client/epo_ops/parsers.py | parsers.py | py | 11,339 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.compile",... |
172487738 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 8 11:09:22 2019
sweep generator
@author: s01li
"""
import numpy as np
import matplotlib.pyplot as plt
import os.path
import scipy.io.wavfile
import soundfile as sf
def Read_sweep_file(filename):
eval_file, fs = sf.read(filename,dtype='float32')
return... | null | GUI_Sitian/sweep_generate.py | sweep_generate.py | py | 1,383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "soundfile.read",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number":... |
630916856 | from django.shortcuts import render, redirect
from .models import User
import logging
logging.basicConfig(filename='sample.log', level=logging.INFO, format='%(asctime)s : %(name)s : %(message)s')
def index(request):
if request.method == 'POST':
name = request.POST.get('name')
message = request.PO... | null | greetingApp/views.py | views.py | py | 1,297 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.info",
"l... |
482337748 | from rest_framework import serializers
from .models import Task
class TaskSerializer(serializers.ModelSerializer):
self = serializers.HyperlinkedIdentityField(
view_name='task-detail'
)
status = serializers.ChoiceField(
choices=Task.STATUS_CHOICES
)
class Meta:
model = T... | null | task_management/serializers.py | serializers.py | py | 550 | 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.HyperlinkedIdentityField",
"line_number":... |
633918976 | from flask import Flask, render_template
import speech_recognition as sr
from summarization import run_summarization
from keywords import get_keyword
from summarizer import summarize
from transcript import trans
# from text_summarizer.text_summarizer import summarizer
app = Flask('app')
trans = trans
@app.route('/'... | null | RethinkIQ/main.py | main.py | py | 839 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "transcript.trans",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_templa... |
529431024 | #!/bin/env python
# See LICENSE file for copyright and license details.
"""Script for generating files from templates."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import sys
from templatz.data import readconfig, readconfig... | null | templatz/command.py | command.py | py | 2,427 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.isdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number"... |
294097671 | from django.db import transaction
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from care.facility.api.serializers import TIMESTAMP_FIELDS
from care.facility.models import Ambulance, AmbulanceDriver
from care.users.api.serializers.lsg import DistrictSerializer
class Amb... | null | care/facility/api/serializers/ambulance.py | ambulance.py | py | 2,586 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "care.facility.models.AmbulanceDriver",
"line_number": 12,
"usa... |
431413611 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
读取pic文件夹中的图片,并改变其分辨率
'''
import os
from PIL import Image
# def find_picture(path):
# files=os
'''假定ip5的屏幕大小为400*300'''
def fixed_size(in_dir,out_dir,width=400,height=300):
imgs=os.listdir(in_dir)
for img_name in imgs:
try:
img_path = o... | null | day6/day6.py | day6.py | py | 1,046 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_numbe... |
28222760 | #! python
# luckygoogle.pl - script responsible for opening few searching result from Google Search
from bs4 import element
import requests
import sys
import webbrowser
import bs4
from pprint import pprint
print('Searching...')
res = requests.get('http://google.pl/search?q=' + ' '.join(sys.argv[1:]))
res.raise_for_st... | null | luckygoogle.py | luckygoogle.py | py | 869 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"lin... |
351004134 | #-*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import six
import datetime
if six.PY2:
import md5
else:
from hashlib import md5 # python3
import struct
from collections import OrderedDict
from optparse import OptionParser
import yaml
__version__ = '0.0.1dev'
BUILTIN_KEYWO... | null | papaya.py | papaya.py | py | 21,274 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "six.PY2",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "yaml.resolver",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "collections.OrderedDict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "yaml.add_repre... |
432199276 | import bcrypt
from django.shortcuts import render, HttpResponse, redirect
from .models import Show, Network, Users
from django.contrib import messages
from django.db import IntegrityError
from .decorators import login_protect
@login_protect
def index(request):
shows=Show.objects.all()
context = {
'sal... | null | main/views.py | views.py | py | 5,844 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.Show.objects.all",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Show.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Show",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.s... |
84606439 | #!/logiciel/ms/ref/local/python/bin/python3
from functions import *
import cx_Oracle
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import style
import matplotlib.ticker as ticker
import matplotlib.font_manager as font_manager
import argparse
import os
from tabulate import tabu... | null | sp_top_sql.py | sp_top_sql.py | py | 2,852 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.environ.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
452736937 | import torch
from src.model_lib.MiniFASNet import MiniFASNetV1, MiniFASNetV1SE, MiniFASNetV2, MiniFASNetV2SE
from src.utility import get_kernel, parse_model_name, parse_model_name_new_format
import os
import cv2
from src.data_io import transform as trans
import torch.nn.functional as F
# import tensorflow as tf
# confi... | null | src/utils/pytorch2onnx.py | pytorch2onnx.py | py | 5,107 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "src.model_lib.MiniFASNet.MiniFASNetV1",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "src.model_lib.MiniFASNet.MiniFASNetV2",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "src.model_lib.MiniFASNet.MiniFASNetV1SE",
"line_number": 19,
... |
64195047 | import multiprocessing
import zmq
import zlib
import pickle
import numpy as np
from typing import Any
"""
zmqhelpers.py
Helper functions using the zmq library.
Also integrates numpy objects.
"""
TERMINATE = b'TERMINATE'
ARRAY = b'ARRAY'
MODEL = b'MODEL'
class EnableTermination:
@staticmethod
def check_term... | null | zmqhelpers.py | zmqhelpers.py | py | 3,484 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.Process",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "zmq.PUSH",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "zmq.Context",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "zmq.XSUB",
... |
414289565 | from tkinter import *
from tkinter import ttk
import time
import xlsxwriter
from datetime import date
import sys
import os
from os import listdir
from os.path import isfile, join
import xlrd
from tkinter import filedialog
from tkinter import messagebox
import tkinter.messagebox
import math
from collec... | null | GUI_BanPest_Login.py | GUI_BanPest_Login.py | py | 3,445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk.Notebook",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk"... |
36491549 | # 生成html报告
import HTMLTestRunner
import os
import smtplib
import time
import unittest
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from public.logger import Log
now = time.strftime('%Y-%m-%d %H-%M-%S')
def add_case(case_path, rule):
"""加载所有的测试用例"""
testU... | null | Test_edaike/main.py | main.py | py | 4,258 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.strftime",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "unittest.TestSuite",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "unittest.defaultTestLoader.discover",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
370436167 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 3 12:31:52 2020
@author: David Chong Tian Wei
"""
from PyQt5.QtWidgets import QMainWindow, QApplication, QVBoxLayout, QDialog, QDialogButtonBox, QAction, QTableView, QFileDialog, QLabel, QLineEdit, QHBoxLayout, QComboBox, QWidget
from PyQt5.QtCore ... | null | ventiliser/GUI.py | GUI.py | py | 17,279 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "ventiliser.PressureStates.PressureStates.peep",
"line_number": 26,
"usage_type":... |
313143618 | import re
import requests
import time
import os
import logging
from lxml import etree
from logging.handlers import RotatingFileHandler
class JD:
def __init__(self, shop_id):
self.shop_id = str(shop_id)
self.item_id = str()
self.results_file_name = 'JD/' + self.shop_id + '.txt'
self... | null | jd.py | jd.py | py | 8,131 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": ... |
617871887 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author Admin
@date 2018/7/2 19:38
"""
# from multiprocessing import Process, Manager
#
# def func(dic):
# dic['count'] -= 1
# print(dic)
#
# if __name__ == '__main__':
# m = Manager()
# dic = m.dict({'count': 100})
# p_list = []
# p = Process(... | null | 多进程/进程间通信/14_进程间的数据共享.py | 14_进程间的数据共享.py | py | 919 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multiprocessing.Lock",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Manager",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Process",
"line_number": 40,
"usage_type": "call"
}
] |
238558331 | """Establish class def for general cell features."""
# Authors: Mainak Jas <mjas@mgh.harvard.edu>
# Sam Neymotin <samnemo@gmail.com>
import numpy as np
from neuron import h, nrn
# Units for e: mV
# Units for gbar: S/cm^2
class _ArtificialCell:
"""The ArtificialCell class for initializing a NEURON feed... | null | hnn_core/cell.py | cell.py | py | 17,504 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "neuron.h.Vector",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "neuron.h.VecStim",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "neuron.h",
"line_number... |
361169896 | registry_hard = '130.85.251.172'
replica_hard = '130.85.241.172'
from zeep import Client
import socket #socket library
import os
import pyping
PORT = 12345
PORT2 = 12346
#registry_hard = '127.0.0.1' #localhost
#host = socket.gethostname() #return a hostname of this machine
mssg = 'Request Subtracter'
# ping if ... | null | subtracter_client.py | subtracter_client.py | py | 1,145 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyping.ping",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
... |
349605139 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 7 17:41:18 2018
@author: zachb
"""
def onehotletter(s):
result = [0] * 26
if s == ' ':
return result
letter_index = ord(s) - 97
result[letter_index] = 1
return result
def onehotword(word):
result = []
word = word + ((10 - len(word)) ... | null | englishOrSpanishInteractive.py | englishOrSpanishInteractive.py | py | 1,352 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.DataFrame",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "keras.models",
"line_number": 53,
"usage_type": "attribute"
}
] |
250380144 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 19 09:59:52 2019
@author: arun
"""
import numpy as np
import matplotlib.pyplot as plt
angles = np.linspace(0, 2.0*np.pi, 101)
sine = np.sin(angles)
cosine = np.cos(angles)
xticks = np.linspace(0, 7, 15)
yticks = np.linspace(-1, 1, 11)
plt.figure(... | null | Workshop/sample.py | sample.py | py | 830 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.sin",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number":... |
90799779 | import os
import re
import pathlib
import gzip
import json
import tbapy.models
cache_dir = 'cache/'
fn_dir = 'fn/'
api_dir = 'api/'
# https://github.com/django/django/blob/master/django/utils/text.py#L219
def get_valid_filename(s):
s = str(s).strip().replace(' ', '_')
return re.sub(r'(?u)[^-\w.]', '', s)
d... | null | cache.py | cache.py | py | 1,027 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "re.sub",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "gzip.open",
"line_number": 25,... |
555254702 | import urllib.request as urllib2
import requests
import json
class IdentifyCode:
__identify_v_code_key = '1c4d515b1908c1700015b5d83855ea66'
__type_id = 34
__convert_to_jpg = 0
__identify_url_interface = 'https://way.jd.com/showapi/checkcode_ys'
@staticmethod
def file_get_contents(filename,... | null | ucar_project_used/crawler/crawler2/identify_v_code.py | identify_v_code.py | py | 1,764 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "urllib.request",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "json.loads",
... |
228376036 |
# ocr-ing pdf
import os, json
import pdf2image, pytesseract
import functions
import yaml
import removecomments
### variables
settingsFile = "settings.yml"
settings = yaml.safe_load(open(settingsFile))
memexPath = settings["memex_path"]
def ocrPublication(pathToMemex, citationKey, language):
#citationKey = ... | null | memex_HOMEWORK/ocr_test.py | ocr_test.py | py | 3,613 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "yaml.safe_load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "functions.generatePublPath",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
396879259 | from django.conf import settings
from django.db.models import Model, BooleanField, CharField, DateTimeField, \
EmailField, ForeignKey, IPAddressField, ManyToManyField, TextField
from django.utils.translation import ugettext_lazy as _
from utils import get_activation_code
class Subscriber(Model):
class Meta... | null | mailinglists/models.py | models.py | py | 4,386 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 14,
"usage_type": "... |
513674832 | import typing as t
import asyncio
from functools import partial
class AExecutor:
def __init__(self):
self.q = asyncio.Queue()
async def __aenter__(self) -> t.Callable[..., t.Awaitable[None]]:
async def loop():
while True:
afn = await self.q.get()
if a... | null | examples/python/dst/11async-with/main.transform.gen.py | main.transform.gen.py | py | 1,177 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "asyncio.Queue",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "typing.Awaitab... |
542242572 | import pandas as pd
import take_data_v2 as take
import matplotlib.pyplot as plt
import numpy as np
import pymorphy2
import re
import keras
from keras.utils.np_utils import to_categorical
from sklearn.preprocessing import LabelEncoder
from keras.models import Sequential
from keras.layers import Dense
fro... | null | Задача 1/Версия 1/v4.py | v4.py | py | 6,784 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "take_data_v2.body",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "take_data_v2.body",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.read_pickle",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "keras.preproce... |
271117428 | """
Copyright 2015 Rackspace
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, software
dist... | null | metatests/cloudcafe/events/models/compute/test_instance_create.py | test_instance_create.py | py | 7,409 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cloudcafe.events.models.compute.instance_create.InstanceCreateStart._dict_to_obj",
"line_number": 117,
"usage_type": "call"
},
{
"api_name": "cloudcafe.events.models.compute.instance... |
527754082 | import z3
import operator
import functools as ft
def hamming_a(bv):
s = bv.size()
return z3.Sum([(bv >> i) & 1 for i in range(s)])
# faster than a
def hamming_b(bv):
s = bv.size().bit_length()
return z3.Sum([z3.ZeroExt(s, z3.Extract(i,i,bv)) for i in range(bv.size())])
# faster than b
def hamming_c... | null | mothball/z3util.py | z3util.py | py | 10,002 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "z3.Sum",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "z3.Sum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "z3.ZeroExt",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "z3.Extract",
"line_number": 13,
"usag... |
537318871 | from __future__ import absolute_import, unicode_literals
from django.core.management.base import NoArgsCommand
from wagtail.wagtailcore.models import Page
class Command(NoArgsCommand):
def set_subtree(self, root, root_path):
root.url_path = root_path
root.save(update_fields=['url_path'])
... | null | wagtail/wagtailcore/management/commands/set_url_paths.py | set_url_paths.py | py | 545 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.NoArgsCommand",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "wagtail.wagtailcore.models.Page.get_root_nodes",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wagtail.wagtailcore.models.Page",
"line_number": 16,
... |
89266756 | import msgpack
from mixins import mixins
from util import VimError
class Remote(object):
"""
Base class for all remote objects(Buffer, Window...).i
"""
def __init__(self, vim, handle):
"""
This is the only initializer remote objects need
"""
self._vim = vim
self... | null | neovim/client.py | client.py | py | 5,048 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msgpack.Unpacker",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "msgpack.packb",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "msgpack.unpackb",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "mixins.mixins.items",
... |
474079915 | import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.figure_factory as ff
import dash
from jupyter_dash import JupyterDash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
external_stylesheets... | null | app.py | app.py | py | 7,773 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "plotly.figure_factory.create_table",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "plotly.figure_factory",
"line_number": 64,
"usage_type": "name"
},
{
"api_name... |
605695947 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | null | sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/request_py3.py | request_py3.py | py | 3,161 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msrest.serialization.Model",
"line_number": 15,
"usage_type": "name"
}
] |
553524389 | import torch
def word_accuracy(logits: torch.Tensor, tgt_seq: torch.Tensor, reduction="average"):
assert reduction in ("average", "sum", "none", None)
pred = logits.argmax(dim=-1)
mask = tgt_seq != 0
if pred.size(1) > tgt_seq.size(1):
base = torch.zeros_like(pred)
base[:, :tgt_seq.size... | null | kotonoha/metrics/accuracy.py | accuracy.py | py | 788 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.Tensor",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.zeros_like",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.zeros_like",
"line_number": 13,
"usage_type": "call"
}
] |
227452657 | import json, requests
from flask import (
Flask,
redirect,
request,
url_for,
jsonify,
session
)
import pymongo, sys, logging
from bson.objectid import ObjectId
from bson.json_util import dumps
from flask_login import (
LoginManager,
current_user,
login_required,
login_user,
... | null | server/api/__init__.py | __init__.py | py | 3,755 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "flask_cors.CORS",
... |
447337957 | import requests
from bs4 import BeautifulSoup
import time
from tools.status import *
def download(link):
filename = link.split('/')[-1]
print_status("downloading {}".format(filename))
try:
r = requests.get(link, stream=True)
with open('saves/' + filename, "wb") as f:
... | null | modules/file_downloader.py | file_downloader.py | py | 3,103 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_nu... |
282857151 | import os
import sys
from godaddypy import Client, Account
from configparser import ConfigParser
import logging
script_dir = os.path.dirname(os.path.realpath(__file__))
config = ConfigParser()
try:
config.read(script_dir + "/config.ini")
except Exception as err:
sys.exit(f"Config parse: {err}")
API_KEY = os.... | null | clean.py | clean.py | py | 1,234 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser"... |
257320212 | import sys
import jinja2
import drinkz.db
import drinkz.recipes
from drinkz.convert import to_ml
# jinja2 global variables
loader = None
env = None
# initializer function
def init_page_builder(templatePath):
global loader, env
loader = jinja2.FileSystemLoader(templatePath)
env = jinja2.Environment(loader... | null | drinkz/page_builder.py | page_builder.py | py | 3,764 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "drinkz.db.db.get_all_recipes",
"line_number": 32,
"usage_type": "call"
},
{
"api_name"... |
67368701 | from typing import List
from catalyst.callbacks.metric import BatchMetricCallback
from catalyst.metrics.accuracy import accuracy, multilabel_accuracy
from catalyst.metrics.functional import (
get_default_topk_args,
wrap_metric_fn_with_activation,
wrap_topk_metric2dict,
)
class AccuracyCallback(BatchMetri... | null | catalyst/callbacks/metrics/accuracy.py | accuracy.py | py | 3,714 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "catalyst.callbacks.metric.BatchMetricCallback",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": ... |
205270554 | import pymysql
import settings
class Database:
"""Everything needed for the Database"""
def __init__(self):
"""Initialisation"""
self.database_server_ip = "localhost"
self.database_user_name = settings.USER_NAME
self.database_user_password = settings.PASSWORD
self.datab... | null | Database.py | Database.py | py | 9,916 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "settings.USER_NAME",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "settings.PASSWORD",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pymysql.cursors",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "p... |
393997669 | from flask import jsonify
from flask_restful import request, Resource
from .experiment.experiment_cache import ExperimentCache
import json
import numpy as np
class Annotation(Resource):
def put(self, experiment_name, sample_idx):
req_json = json.loads(request.data.decode('utf-8'))
ma... | null | api/annotation.py | annotation.py | py | 1,542 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask_restful.Resource",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask_restful.request.data.decode",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fl... |
246397986 | #!/usr/bin/env python3
# Copyright (C) 2020-2021 Andrew Trettel
#
# SPDX-License-Identifier: MIT
import csv
import math
import sqlite3
import sheardata as sd
import sys
conn = sqlite3.connect( sys.argv[1] )
cursor = conn.cursor()
cursor.execute( "PRAGMA foreign_keys = ON;" )
flow_class = sd.BOUNDARY_LAYER_FLOW_... | null | src/pre_B2018001.py | pre_B2018001.py | py | 641 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sheardata.BOUNDARY_LAYER_FLOW_CLASS",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name":... |
630388275 | import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QMainWindow, QApplication
import filesmanager
class MainWindow(QMainWindow):
file_manager: QMainWindow
def __init__(self):
super().__init__()
uic.loadUi("uis/startpage.ui", self)
self.SelectFileButton.clicked.connect(self.op... | null | startpage.py | startpage.py | py | 607 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 12,
"usage_type": "call"
},
{
"api_name":... |
140306596 | """Steps for features of Oneprovider's spaces.
"""
__author__ = "Michal Cwiertnia"
__copyright__ = "Copyright (C) 2016 ACK CYFRONET AGH"
__license__ = "This software is released under the MIT license cited in " \
"LICENSE.txt"
from pytest_bdd import parsers, then
from tests.gui.steps.common import find... | null | tests/gui/steps/oneprovider_spaces.py | oneprovider_spaces.py | py | 1,717 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest_selenium_multi.pytest_selenium_multi.select_browser",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.support.ui",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "pytest_bdd.then",
"line_number": 18,
"usage_... |
9465698 | #OHLC 캔들
# OHLC 는 Open-High-Low-Close를 나타내며 시가-고가-저가-종가를 의미한다.
# 차트는 OHLC 에 해당하는 네 가지 가격을 이용하여 일정 기간의 가격 변동을 표시한다.
#셀트리온
from bs4 import BeautifulSoup
from urllib.request import urlopen
import pandas as pd
from matplotlib import pyplot as plt
#맨 뒤 페이지 숫자 구하기
url = 'https://finance.naver.com/item/sise_day.nhn?code=068... | null | Celltron_PlotChart.py | Celltron_PlotChart.py | py | 1,541 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read... |
319123970 | import requests
import json
import time
game_ids = []
lane_dict = {}
champion_info = dict()
account_id = "VWNSbDLytNV47o6jJ0E9TtD5OEPG3ENocgp9Pro9Y3iQ6Tc"
match_v4_accountid = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/"+str(account_id)+"?api_key=RGAPI-4dcd2099-2605-4440-9864-f53a305141e7"
accou... | null | 데마시아5/DEMACIA5/djangobackend/demacia/match.py | match.py | py | 2,253 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
}
] |
489521490 | __author__ = 'jonengelbert'
import tournament
import datetime
import random
class Tourney(object):
def __init__(self, name, date=datetime.date.today(), location = ""):
self.name = name
self.date = date,
self.location = location
self.id = None
def delete_from_db(self):
"... | null | Tourney.py | Tourney.py | py | 2,133 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.date.today",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tournament.connect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tournament.co... |
163231393 | import matplotlib.pyplot as plt
import matplotlib.image as img
import matplotlib.cm as cm
import numpy as np
from operator import add
from functools import reduce
import cv2
def find_max_min(img,xi,xf,yi,yf):
max_value_r = 0
min_value_r = 255
max_value_g = 0
min_value_g = 255
max_value_b = 0
... | null | 11_Region_split_merge.py | 11_Region_split_merge.py | py | 4,562 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.image",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.image",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "matplotlib.image",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "matplotlib.image",... |
81869161 | from easydict import EasyDict
pendulum_td3_bc_config = dict(
exp_name='pendulum_td3_bc',
env=dict(
collector_env_num=8,
evaluator_env_num=5,
# (bool) Scale output action into legal range.
act_scale=True,
n_evaluator_episode=5,
stop_value=-250,
),
policy=d... | null | dizoo/classic_control/pendulum/config/pendulum_td3_bc_config.py | pendulum_td3_bc_config.py | py | 2,001 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "easydict.EasyDict",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "easydict.EasyDict",
"line_number": 68,
"usage_type": "call"
}
] |
206720371 | from five import grok
from Acquisition import aq_inner
from zope import schema
from zope.lifecycleevent import modified
from plone.directives import form
from z3c.form import button
from plone.app.textfield import RichText
from plone.namedfile.field import NamedBlobImage
from plone.dexterity.utils import createContent... | null | src/pressapp.presscontent/pressapp/presscontent/addrelease.py | addrelease.py | py | 3,540 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "plone.directives.form.Schema",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "plone.directives.form",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "zope.schema.TextLine",
"line_number": 19,
"usage_type": "call"
},
{
"api_... |
310155797 | from django.shortcuts import render,HttpResponse
from django.views import View
from stock.models import StockProduct,StockRecord,Stock
from sales.models import SalesProduct,time_to_str
from purchase.models import PurchaseProduct,PurchaseContract
from invoice.models import Invoice,InvoiceProduct
from invoice.forms impor... | null | ForeignTrade/headquarters/stock/views.py | views.py | py | 12,546 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "stock.models",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "stock.models.Stock.objects.all",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "stock.models.Stock.objects",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_n... |
296838293 | from flask import Blueprint, redirect, request
from decorators import api_wrapper
from models import db, Polls, Votes
import utils
blueprint = Blueprint("api", __name__)
@blueprint.route("/poll/new", methods=["POST"])
@api_wrapper
def new_poll():
pid = utils.random_string()
title = request.form.get("title",... | null | api.py | api.py | py | 710 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utils.random_string",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.reque... |
490673680 | from django.shortcuts import render,redirect,get_object_or_404
from django.conf import settings
from orders.models import Order
import braintree
from .task import payment_completed
# Create your views here.
gateway = braintree.BraintreeGateway(settings.BRAINTREE_CONF)
def payment_process(request):
order_id = request... | null | shopit/payment/views.py | views.py | py | 1,297 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "braintree.BraintreeGateway",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.BRAINTREE_CONF",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 7,
"usage_type": "name"
},
{
... |
503247116 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv("Position_Salaries.csv")
X = df.iloc[:, 1:2].values
y = df.iloc[:, 2].values
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2)
from sklearn.tree import ... | null | All Linear Regression/10 14/DecisionTreeRegression.py | DecisionTreeRegression.py | py | 678 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeRegressor",
"line_number": 15,
"usage_type": "call"
},... |
74486420 | # coding:utf-8
import uuid
__author__ = 'nightwind'
from http.cookiejar import Cookie
import io
import json
import random
from urllib import request, parse
from http import cookiejar
import rsa
import binascii
from tkinter import *
from PIL import Image, ImageTk
from bs4 import BeautifulSoup
import time
url_get_user... | null | tiancity.py | tiancity.py | py | 6,334 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.parse.urlencode",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "rsa.PublicKey",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "rsa.encrypt",
"... |
76370074 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0007_auto_20160715_0959'),
]
operations = [
migrations.AlterModelOptions(
name='category',
op... | null | app/migrations/0008_auto_20160717_1936.py | 0008_auto_20160717_1936.py | py | 615 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
552342959 | from web3 import Web3
### QUESTION 1 ###
# initialise ganache-cli
ganache_url = "http://127.0.0.1:8545"
account_A = "0xb7E3ce48db46bb49E9140C607FC004170B53541F"
account_B = "0x80385Ac99d7d9811eF407B97f92AFdab72B14988"
private_key_A = "0xc75a9d122d28f100248f4dd638c83118a91fcb60cb9d215f4484bd940b1c89a3"
# connect W... | null | 2020_50.037-Blockchain-Technology/10_Exercise_1.py | 10_Exercise_1.py | py | 1,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "web3.Web3",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "web3.Web3.HTTPProvider",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "web3.eth.getTransactionCount",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "web3.et... |
364415067 | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
'''
point=[1,2] or point=[[1,2]]
points=[[1,2],[2,3]]
polygons=[polygon1,polygon2]
'''
def plotPoints(points, style='bo'):
if type(points) == list:
if not type(points[0]) == list:
points = [points]
poi... | null | nogeo/draw.py | draw.py | py | 1,697 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
581788407 | """The Enphase Envoy integration."""
from __future__ import annotations
from datetime import timedelta
import logging
import async_timeout
from envoy_reader.envoy_reader import EnvoyReader
import httpx
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PAS... | null | homeassistant/components/enphase_envoy/__init__.py | __init__.py | py | 3,879 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.timedelta",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "homeassistant.core.HomeAssistant",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": ... |
54698210 | from bs4 import BeautifulSoup
import os
import ast
import requests
import pandas as pd
# out_file = "all-players.html"
# url = "http://stats.nba.com/players/"
# cmd = "curl -L -m 20 '%s' > %s"%(url, out_file)
# os.system(cmd)
def get_all_players():
f = open('players.html', 'r')
html_doc = f.read()
f.close()
so... | null | main.py | main.py | py | 4,595 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
446067386 | # Copyright 2014 Tesora, Inc.
# 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 ... | null | trove/guestagent/strategies/replication/mysql_base.py | mysql_base.py | py | 5,985 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "trove.guestagent.backup.backupagent.BackupAgent",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "trove.common.cfg.CONF",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "trove.common.cfg",
"line_number": 32,
"usage_type": "name"
}... |
497570814 | import os
import requests
import json
global ACCESS_TOKEN
def get_access_variables():
file = os.path.dirname(os.path.abspath(__file__)) + '/spotify_refresh_token.txt'
with open (file, "r") as file:
info=json.loads(file.read())
info['grant_type'] = 'refresh_token'
return(info)
def get_access_token():
if 'A... | null | lib/access_spotify.py | access_spotify.py | py | 786 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_numb... |
587555331 | # from collections import OrderedDict
from rest_framework.pagination import PageNumberPagination
# from rest_framework.response import Response
class CustomPageNumberPagination(PageNumberPagination):
page_size_query_param = 'page_size'
def paginate_queryset(self, queryset, request, view=None):
if s... | null | conttudoweb/pagination.py | pagination.py | py | 947 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 7,
"usage_type": "name"
}
] |
26549384 | import web
import model
urls = (
'/', 'Index',
'/phones/list', 'Phone_List',
'/phone', 'Phone',
'/phone/(\d+)', 'Phone',
'/activity/list', 'Activity_List',
'/activity', 'Activity',
'/activity/(\d+)', 'Activity',
)
### Templates
render = web.template.render('templates', base='base')
class... | null | app.py | app.py | py | 2,962 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "web.template.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "web.template",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "model.get_phones",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "web.form.Form"... |
219056219 | from processors import Processors
import asyncio, sys, csv, os
class LoadStockOptionsCsv(Processors):
def __init__(self):
self.total_files = []
self.mode = 'options'
self.fp = '/home/scott/Insync/scott@scottstreit.com/option history/livediscount2014_optiondatabucketzip/2014_1/2014_1/'
... | null | python/load_stock_options_csv.py | load_stock_options_csv.py | py | 4,192 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "processors.Processors",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "processors.Processors.__init__",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "processors.Processors",
"line_number": 9,
"usage_type": "name"
},
{
"api_name"... |
440627504 | from interfaces.schemas.management import Organization, Workspace
from interfaces.schemas.management import User, Invite
from lib.routes import Routes, Route, OrgRoute
__author__ = 'OrW'
class ManagementRoutes(Routes):
class Users(Route):
URLS = ["/apiv1/users/<string:id>"]
SCHEMA = User
... | null | interfaces/routes/rookout/management_routes.py | management_routes.py | py | 1,295 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lib.routes.Routes",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "lib.routes.Route",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "interfaces.schemas.management.User",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "l... |
626772687 | from typing import Callable, Union
from tqdm import tqdm
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist, pdist
from scipy.sparse import issparse
from scipy.optimize import fsolve
import numdifftools as nd
from multiprocessing.dummy import Pool as ThreadPool
import multiprocessing as mp
... | null | dynamo/vectorfield/utils.py | utils.py | py | 35,565 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.any",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.logical_or",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numdifftools.Gradient",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numdifftools.Hessdia... |
957748 | from itertools import groupby
# import matplotlib.pyplot as plt
path = 'results/numbers.csv'
fail = open(path, 'r')
fail_data = fail.read().split('\n')
fail.closed
data_list = []
max_len = 0
for line in fail_data:
draw_date = line[0]
""" [8, 4, 3] """
ball_list = line.split(';')[2].split('-')
balls =... | null | modules/new_york/ploter.py | ploter.py | py | 635 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "itertools.groupby",
"line_number": 22,
"usage_type": "call"
}
] |
591352080 | from database_mongo import *
import pprint
import json
def search(info):
# search = str(input("Enter the chain you wanna search: "))
data = info.upper()
# searching using regex
ans = search_chains(data)
# checking the length of the data recived by us and printing the data
# pprint.pprint(ans... | null | simple_search.py | simple_search.py | py | 1,024 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.dump",
"line_number": 32,
"usage_type": "call"
}
] |
57475787 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################## ##############################
######################### Detection module #########################
######################### ######################### #############################
### Contains all the function... | null | Detection.py | Detection.py | py | 35,042 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.power",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "scipy.special.lambertw",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"lin... |
229044544 | #
# Base class for convection submodels
#
import pybamm
class BaseModel(pybamm.BaseSubModel):
"""Base class for convection submodels.
Parameters
----------
param : parameter class
The parameters to use for this submodel
**Extends:** :class:`pybamm.BaseSubModel`
"""
def __init__... | null | pybamm/models/submodels/convection/base_convection.py | base_convection.py | py | 3,323 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pybamm.BaseSubModel",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pybamm.Concatenation",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "pybamm.Concatenation",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "pyb... |
324108328 | from MejoramientoPoliticaDescuento import mejoramientoPoliticaDescuento
from MejoramientoPolitica import mejoramientoPolitica
from AproximacionSucesiva import aproximacionSucesiva
from EnumeracionExahustiva import Enumeracion_Politicas
from ejercicio_ppl import ppl
#from (nombre archivo) import (nombre funcion)
im... | null | main.py | main.py | py | 7,799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
194847829 | #This file is used to scan in the readings from the ultrasonic sensor and
#store them within a csv file which will be used for training the neural
#network.
import serial
from time import sleep
import numpy as np
import tensorflow as tf
import keyboard as kb
from numpy import asarray
from numpy import savetxt
import cs... | null | StillScan.py | StillScan.py | py | 2,534 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_ALL",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "serial.Serial",
"line_n... |
256696943 | import error
from token_type import TokenType
import token_
import expr
import stmt
class Parser:
def __init__(self, tokens):
self.tokens = tokens
self.current = 0
def match(self, *types):
if not self.isAtEnd():
for t in types:
if self.tokens[self.current].... | null | tree-walk-interpreter/parser_.py | parser_.py | py | 12,250 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "token_type.TokenType.EOF",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "token_type.TokenType",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "error.hadError",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name":... |
312952652 | #Author:ike yang
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import minimize, rosen, rosen_der
data1_path=r'F:\python\py书籍\Coursera吴恩达机器学习Matlab和Python代码\Coursera-ML-using-matlab-python-master\coursera_ml_ipynb\ex2\data\ex2data1.txt'
b=np.loa... | null | 吴恩达_ML/ex2_logicalRegression/main_linearBoundary.py | main_linearBoundary.py | py | 1,770 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.loadtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "seaborn.scatterplot",
"li... |
98884012 | """ Methods to read/write our PAE models """
import os
import json
import pickle
from torch import embedding
from ulmo.ood import ood
from ulmo import io as ulmo_io
from IPython import embed
def load_ulmo_model(model_name:str, datadir=None, local=False):
"""Load up an Ulmo model including the
MODIS L... | null | ulmo/models/io.py | io.py | py | 2,903 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
522588378 | '''
Problem 3 위장
[문제 요점]
1. 경우의 수 고려할 때 안 입는 경우 +1 씩 한 후, 둘다 안 입는 경우 제외해서 -1 해주기.
[1차 시도 결과]
정확성 100.0
합계 100.0 / 100.0
'''
def multiply(arr):
ans = 1
for n in arr:
if n == 0:
return 0
ans *= n
return ans
def solution(clothes):
c = {}
for i in clothes:
c[i[0... | null | hashing/[programmers] hashing-3.py | [programmers] hashing-3.py | py | 1,353 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "collections.Cou... |
297261007 | import jinja2
import webapp2
import os
import models
from models import Search
the_jinja_env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
class HomePage(webapp2.RequestHandler):
def get(self):
result_t... | null | main.py | main.py | py | 1,297 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "jinja2.Environment",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "jinja2.FileSystemLoader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
95026351 | import itertools
from collections import defaultdict
import torch
from fastNLP.core.batch import Batch
from fastNLP.core.sampler import RandomSampler
from fastNLP.core.utils import _build_args
class Tester(object):
"""An collection of model inference and evaluation of performance, used over validation/dev set an... | null | fastNLP/core/tester.py | tester.py | py | 2,961 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "collections.defaultdict",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "fastN... |
310643967 | import numpy as np
import keras
from PIL import Image
label_colormap = {
"unlabeled":(0,0,0),
"ego vehicle":(0,0,0),
"rectification border":(0,0,0),
"out of roi":(0,0,0),
"static":(0,0,0),
"dynamic":(111,74,0),
"ground":(81,0,81),
"road":(128,64,128),
"sidewalk":(244, 35,232),
"... | null | ErfNet/get_data_from_carla.py | get_data_from_carla.py | py | 3,163 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 99,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_num... |
151458987 | import pandas as pd
import random
from matplotlib import pyplot as plt
from sklearn.neural_network import MLPClassifier
from sklearn.neural_network import MLPRegressor
# Load representations for training and testing the model
orth_train = pd.read_csv("examples/train_orth.csv", header=None, keep_default_na=False, index... | null | models/extended-score/FitModel-300-low-scores.py | FitModel-300-low-scores.py | py | 1,880 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
628064766 | import sys
import csv
import numpy
from matplotlib import pylab
from matplotlib import pyplot
axis = [-5, 35, -5, 45]
data = numpy.genfromtxt(sys.argv[1], delimiter=sys.argv[2])
distance_map = None
if sys.argv[3]:
distance_map = numpy.genfromtxt(sys.argv[3],delimiter=sys.argv[2])
f = open('relacionados.csv', 'rb')... | null | som_vizualizer.py | som_vizualizer.py | py | 906 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.genfromtxt",
"li... |
565998168 |
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dropout, Flatten, Dense
from keras import applications
import matplotlib.pyplot as plt
from keras.utils.np_utils import to_categorical
img_width, img_height = 150, 150
cnn_updat... | null | feature extraction/inceptionv3.py | inceptionv3.py | py | 3,876 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.preprocessing.image.ImageDataGenerator",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "keras.applications.InceptionV3",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "keras.applications",
"line_number": 26,
"usage_type": "name"
... |
388659578 | # Copyright 1999-2018 Alibaba Group Holding 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 a... | null | mars/worker/taskqueue.py | taskqueue.py | py | 10,148 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "utils.WorkerActor",
"line_number": 79,
"usage_type": "name"
},
{
"api_name": "heapq.heappush",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
... |
637930880 | # This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
from typing import Any, Text, Dict, List
import json
from pathlib import Path
from rasa_sdk import Action, Tracker
from rasa_sdk.exec... | null | actions/actions.py | actions.py | py | 9,070 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rasa_sdk.Action",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.Text",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "rasa_sdk.executor.Collecting... |
395961416 | from observable import Core
from observer import Node
core = Core()
core.name = 'core'
core.temperature = '23'
node_1 = Node('node_1')
node_2 = Node('node_2')
node_3 = Node('node_3')
core.addObserver(node_1)
core.addObserver(node_2)
core.addObserver(node_3)
core.add_data('new data')
core.add_data('newer data')
co... | null | design_patterns/observer/observer_test.py | observer_test.py | py | 567 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "observable.Core",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "observer.Node",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "observer.Node",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "observer.Node",
"line_n... |
27605450 | #!/usr/bin/env python3
import threading, logging, time
import multiprocessing
from kafka import KafkaProducer
"""
Reader reads from data files and then sends in a Producer
"""
class Producer(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.stop_event = threading.Event()
... | null | scripts/data_reader.py | data_reader.py | py | 1,515 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "threading.Thread",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.