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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
451320939 | from addons.base.apps import BaseAddonAppConfig
class TeiCloseAddonConfig(BaseAddonAppConfig):
name = 'addons.teiclose'
label = 'addons_teiclose'
full_name = 'TEI Close Reading'
short_name = 'teiclose'
owners = ['node']
views = ['page']
categories = ['visualizations']
has_hgrid_files =... | null | addons/teiclose/apps.py | apps.py | py | 559 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "addons.base.apps.BaseAddonAppConfig",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "routes.page_routes",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "routes.api_routes",
"line_number": 21,
"usage_type": "name"
}
] |
621042013 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import serial.tools.list_ports
def serial_port():
port = [p.device for p in serial.tools.list_ports.comports()]
#if 'Silicon Labs CP210x USB to UART Bridge' in p.description]
if not port:
raise IOError("No USB-to-Serial device foun... | null | serial_port.py | serial_port.py | py | 696 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.tools.list_ports.tools.list_ports.comports",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "serial.tools.list_ports.tools",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "serial.tools.list_ports",
"line_number": 8,
"usage_typ... |
346982335 | import hashlib
from random import randint
from django.shortcuts import render
from django.http import JsonResponse, HttpResponseRedirect
from django.urls import reverse
from servidor.models.usuario import Usuario
from servidor.models.servico import Servico
from servidor.email import enviar_chave
from servidor.sessao i... | null | servidor/views.py | views.py | py | 8,426 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "servidor.models.usuario.Usuario.objects.filter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "servidor.models.usuario.Usuario.objects",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "servidor.models.usuario.Usuario",
"line_number": ... |
61211359 | import cv2 as cv
import sys, numpy, pytesseract
from PIL import Image
from picamera import PiCamera
cam = PiCamera()
class ImageProcessor:
def __init__(self, img1, img2):
# self.path = pathname
cam.capture('images/card.jpg')
self.img = cv.imread(cv.samples.findFile(img1))
self.img2... | null | src/card_reader/img_proc.py | img_proc.py | py | 1,343 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "picamera.PiCamera",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.samples.findFile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.samples",
"l... |
233379685 | import numpy as np
import camb
import time
from matplotlib import pyplot as plt
def get_spectrum(pars,lmax=1199):
H0=pars[0]; ombh2=pars[1]; omch2=pars[2]
tau=pars[3]; As=pars[4]; ns=pars[5]
pars=camb.CAMBparams()
pars.set_cosmology(H0=H0,ombh2=ombh2,omch2=omch2,mnu=0.06,omk=0,tau=tau) #fixed tau
... | null | HW3/JIAO Hao-3-4-3corr.py | JIAO Hao-3-4-3corr.py | py | 2,456 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "camb.CAMBparams",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "camb.get_results",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_nu... |
230005285 | import networkx as nx
import attributes as attrb
# constants
ATTRB_TYPE = "ReachType"
# variables
inShp = r'C:\dev\pyGNAT\shapefiles\NHD_Braids.shp'
outShp = r'C:\JL\Testing\pyGNAT\NetworkFeatures\Out\reach_types.shp'
G = nx.read_shp(inShp, simplify=False)
attrb.add_attribute(G, ATTRB_TYPE, "connector") # add 'defa... | null | experiments/jesse/reach_types.py | reach_types.py | py | 1,838 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.read_shp",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "attributes.add_attribute",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "networkx.DiGraph",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "attribute... |
500315133 | import airsim
import cv2
import numpy as np
client = airsim.MultirotorClient()
IMAGE_NORMAL = airsim.ImageType.Scene
min_disp = 16
window_size = 17
stereo = cv2.StereoBM_create(numDisparities=32, blockSize=5)
stereo.setMinDisparity(0)
stereo.setNumDisparities(32)
stereo.setBlockSize(6)
stereo.setDisp12MaxDiff(1)
... | null | DepthMapperCont/PythonClient/depth_cam/depth_map_bm.py | depth_map_bm.py | py | 1,369 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "airsim.MultirotorClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "airsim.ImageType",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cv2.StereoBM_create",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy... |
310861751 | #Bikeshare Project
import time
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
CITY_DATA = { 'chicago': 'chicago.csv',
'new york city': 'new_york_city.csv',
'washington': 'washington.csv' }
def month_filter():
""" Ask the user to enter month and test if... | null | bikeshare_2.py | bikeshare_2.py | py | 14,131 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 157,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
... |
129225009 | import cv2
import numpy as np
#Program to search for a template image in a larger image
img = cv2.imread("messi5.jpg")
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
template = cv2.imread("messi_face.jpg", 0)
w, h = template.shape[::-1] #Gives column and row value in reverse order
res = cv2.matchTemplate(gray_img... | null | OpenCV/10_template_matching_opencv_python.py | 10_template_matching_opencv_python.py | py | 753 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_n... |
602882833 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.8.5 (default, Aug 12 2020, 00:00:00)
# [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
# Embedded file name: c:\Jenkins\live\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\MPD226\MPD226.py
# Compiled at: 2020-07-14 15:33... | null | Live 10.1.18/MPD226/MPD226.py | MPD226.py | py | 2,008 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "_MPDMkIIBase.MPDMkIIBase.MPDMkIIBase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "_Framework.ButtonMatrixElement.ButtonMatrixElement",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "_MPDMkIIBase.ControlElementUtils.make_encoder",
"line... |
103063366 | import logging
from PyQt5 import QtWidgets, QtGui, QtCore, QtOpenGL, Qt
from OpenGL.GL import *
from OpenGL import GL
from OpenGL.GLU import *
import numpy
import copper
import math
from copper import hou as engine
from copper.op.base import OpRegistry
from gui.signals import signals
from gui.widgets import PathBarW... | null | gui/panels/network_view_panel.py | network_view_panel.py | py | 18,023 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "base_panel.NetworkPanel",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "base_panel.NetworkPanel.__init__",
"line_number": 27,
"usage_type": "call"
},
{
"api_na... |
604552894 | def createDepartmentLabs(department,count):
import Filer
import sqlite3
conn = sqlite3.connect(Filer.DATA_BASE_FILE)
c = conn.cursor()
for i in range(1,count+1):
c.execute('Insert into Labs (Name, Department) values (?, ?)',
(('%s LAB%d'%(department,i)), department... | null | a/codefiles/codefiles (copy 1)/lab.py | lab.py | py | 2,228 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "Filer.DATA_BASE_FILE",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "Filer.DATA_BA... |
528103075 | # coding=utf-8
import numpy
import mnist
import scipy.sparse
import scipy.optimize
class SoftmaxRegression(object):
def __init__(self, input_size, num_classes, lamda):
"""
SoftmaxRegression object를 초기화합니다.
:param input_size: input 데이터의 크기
:param num_classes: 분류할 class 개수
:... | null | softmax.py | softmax.py | py | 4,354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.asarray",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
... |
104348780 | import csv
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
motor = create_engine(
"postgres://tybnzuug:sEd-YLwtFP6juILFYUkAKmwTtHpoNasU@drona.db.elephantsql.com:5432/tybnzuug")
# URL de variable de entorno
# engine = create_engine(os.getenv('DATABASE_URL'))
db = scope... | null | importar.py | importar.py | py | 804 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.scoped_session",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 11,
"usage_type": "call"
},
{
... |
59331307 | from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import logout
from django.urls import reverse_lazy
from django.views import generic
from datetime import datetime
from django.contrib.auth.models import User
from .models import Customer, Paymen... | null | tienda_admin/views.py | views.py | py | 43,415 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "models.DailyInput.objects.filter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name... |
358800963 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from collections import namedtuple
from subprocess import CalledProcessError
from subprocess import PIPE
from subprocess import Popen
from subprocess import STDOUT
from .debug i... | null | pgctl/daemontools.py | daemontools.py | py | 4,975 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "debug.debug",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "errors.Unsupervised",
... |
77167785 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
red=pd.read_csv('/Users/cenliang/Downloads/winequality-red.csv',sep=";")
white=pd.read_csv('/Users/cenliang/Downloads/winequality-white.csv',sep=";")
red.index=['red']*len(red)
white.index=['white']*len(white)
allwine = pd.concat([red,white])
all... | null | red_white.py | red_white.py | py | 1,514 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "seaborn.set",
"line_nu... |
309519086 | #!/usr/bin/python3
#
# copyright by Oliver Dippel o.dippel@gmx.de 2019
#
import threading
import serial
import os
import copy
import sys
import glob
import datetime
import time
import argparse
import json
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GdkPixbuf, Gdk, Pango, Gio, GObject
fro... | null | FZ35.py | FZ35.py | py | 13,427 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gi.require_version",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "gi.repository.Gtk.Application",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "gi.repository.Gtk",
"line_number": 41,
"usage_type": "name"
},
{
"api_name"... |
168675883 | from aristotle_mdr.utils import get_download_template_path_for_item
import cgi
import os
from django.http import HttpResponse, Http404
# from django.shortcuts import render
from django.template.loader import select_template, get_template
from django.template import Context
from django.utils.safestring import mark_saf... | null | aristotle_pdf/downloader.py | downloader.py | py | 6,987 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"lin... |
42176266 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## validate.py
##
## Created on: Jan 4, 2019
## Author: Alexey Ignatiev
## E-mail: aignatiev@ciencias.ulisboa.pt
##
#
#==============================================================================
from __future__ import print_function
import getopt
import nump... | null | xgbooster/validate.py | validate.py | py | 6,632 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pysat.formula.IDPool",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "pysmt.shortcuts.Solver",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "pysmt.shortcuts.Symbol",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "py... |
559713707 | from flask import make_response, jsonify
from flask_restful import Resource, reqparse
from backendflask.adapters.memoryrepository import MemoryRepository
from backendflask.adapters.gcloudrepository import GCloudRepository
from backendflask.domain_models.user import User
from backendflask.domain_models.movie import Movi... | null | backendflask/api/user_list.py | user_list.py | py | 3,424 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "backendflask.adapters.memoryrepository.MemoryRepository",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 15,
... |
484093575 | import smtplib
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Check for user imports
# if conflocal.py is not found, import default conf.py
try:
import conflocal as conf
except ImportError:
import conf
def sendEmail(source,... | null | sendemail.py | sendemail.py | py | 1,416 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "email.mime.multipart.MIMEMultipart",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "email.mime.text.MIMEText",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "email.mime.image.MIMEImage",
"line_number": 28,
"usage_type": "call"
},
{... |
52819505 | #!/usr/bin/env python3
#STACY CORE : Contains the Stacy Object, necessary for all crazy stuff
#These imports are necessary for all required packages.
import os, shutil
from random import *
import time
import speech_recognition as sr
from gtts import gTTS
import pyglet
from pygame import mixer
import pygame
import tw... | null | Stacy.py | Stacy.py | py | 3,570 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "SysCommands.readGlobals",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Recognizer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "speech_recognition.Microphone",
"line_number": 38,
"usage_type": "call"
},
{
... |
303088806 | from splinter import Browser
import time
import re
robots = []
max_to_check = 652
inf = open("old-robot-table.csv", "rt")
numbers = [int(line.split(",")[0]) for line in inf]
tocheck = []
for x in range(1, max_to_check):
if not x in numbers:
tocheck.append(x)
inf.close()
with Browser() as browser:
fo... | null | old/splintersearch.py | splintersearch.py | py | 1,779 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "splinter.Browser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "time.sleep",
"line_... |
289919867 | """Script to convert the textured obj file to a ply file with Blender.
NOTE: ONLY TO BE CALLED WITH BLENDER.
"""
import bpy
import sys
import argparse
import math
def make_parser():
"""
:return: The argument parser.
"""
parser = argparse.ArgumentParser("Blender script to postprocess the "
... | null | blender/convert_obj_to_ply.py | convert_obj_to_ply.py | py | 2,500 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "bpy.context",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "bpy.ops.import... |
616673840 | from django.db.models import Min
# helper method for getting date range
def get_dates_between(start_date, end_date, queryset, event_logistics):
if(start_date is not None) and (end_date is not None):
queryset = queryset.filter(is_approved=True).filter(event_logistics__date__range=[start_date, end_date]).ann... | null | api/main_events/helper_methods.py | helper_methods.py | py | 430 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Min",
"line_number": 6,
"usage_type": "call"
}
] |
323639627 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from recipe_db_setup import Base, User, Category, Recipe, Ingredient
engine = create_engine('postgresql+psycopg2://catalog:catalog@localhost/catalog')
# Bind the engine to the metadata of the Base class so that the
# declaratives can be acce... | null | recipe_server/recipes.py | recipes.py | py | 9,467 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "recipe_db_setup.Base.metadata",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "recipe_db_setup.Base",
"line_number": 9,
"usage_type": "name"
},
{
"api... |
336677130 | #!/usr/bin/env python3
# https://en.wikipedia.org/wiki/Anaglyph_3D
# https://github.com/miguelgrinberg/anaglyph.py/blob/master/anaglyph.py
import numpy as np
import cv2
# declare various color blending algorithms to mix te pixels
# from different perspectives so that red/blue lens glasses
# make the image look 3D
mix... | null | computer-vision/anaglyphs/test.py | test.py | py | 2,847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.zeros",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_numb... |
270572384 | # author: adam
# 主题:以下是使用多进程(Pool)发送请求的代码(客户端),它的类型是REQ(同步请求),调用的是connect()。
import time
import zmq
from multiprocessing import Pool
host = '127.0.0.1'
port = 6789
context = zmq.Context()
client = context.socket(zmq.REQ)
client.connect("tcp://%s:%s"%(host, port))
start = time.time()
def client_behave(num):
request... | null | python_to_apply/11th-2_chapter_network/zmq_client_multipro.py | zmq_client_multipro.py | py | 910 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zmq.Context",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "zmq.REQ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "time.time",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_n... |
59404463 | from discord.ext.commands import Cog, command, Context
cog_name = "cog"
class SkelCog(Cog):
def __init__(self, bot):
self.bot = bot
self.log = None
@Cog.listener()
async def on_ready(self):
if not self.bot.ready:
self.log = self.log = self.bot.get_cog('Log')
... | null | skel_cog.py | skel_cog.py | py | 410 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog.listener",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 11,
"usage_type": "name"
}
] |
44962187 | """
Author: David Henry Lippman
File: plotWeb.py
Date created: 04/23/18
Date modified: 09/15/19
"""
from getWebData import getWebData
import numpy as np
import matplotlib.pyplot as plt
def plotWeb(data_type):
# Get data filenames
filename = getWebData(data_type)
# Determine numbe... | null | plotWeb.py | plotWeb.py | py | 5,035 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "getWebData.getWebData",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "nu... |
640237857 | from flask import Flask, request, render_template, jsonify
from argparse import ArgumentParser
import Crypto
import Crypto.Random
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
import binascii
from collections import OrderedDict
import requests
import json
class P... | null | Blockchain_client/blockchain_client.py | blockchain_client.py | py | 4,167 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Crypto.PublicKey.RSA.importKey",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "Crypto.PublicKey.RSA",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "binascii.unhexlify",
"line_number": 23,
"usage_type": "call"
},
{
"api_name":... |
402152704 | #!/bin/env python3
'''
Module to setup vulkan API.
Amended on: 2017-10-21
Amendments: 1. Revised v2 codes to now allow resizing of window according to
Vulkan Tutorial.
2. Removed Vulkan struct's stype, flag, and other parameters with
the "Count" word in their name.
'''
# Py... | null | HelloTriangle/vulkanbase_v3_recreateSwapChain_noSwapDebugPrints.py | vulkanbase_v3_recreateSwapChain_noSwapDebugPrints.py | py | 72,603 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.debug",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "logging.debug",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number": 112,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_n... |
625612183 | # -*- coding: utf-8 -*-
from django import template
from django.utils.translation import get_language
from trips.models import TripImage, TripRequest, TripNotification, TripInvite
register = template.Library()
@register.assignment_tag(takes_context=True)
def member_images(context, trip):
request = context['req... | null | apps/trips/templatetags/trips_tags.py | trips_tags.py | py | 2,490 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "trips.models.TripImage.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_n... |
165643835 | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
# @Time : 2021/7/30 3:37 下午
# @File : batch_run.py
# @Project : jd_scripts
# @Desc : 批量运行当前目录下的所有以jd, jr, jx, dj开头的活动脚本。
import time
import os
import sys
from utils.logger import logger
def get_py():
"""
获取python 文件
"""
pwd = os.path.split(os.pa... | null | batch_run.py | batch_run.py | py | 1,117 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_numbe... |
269826849 | import argparse
import logging.config
import sys
import yaml
from mongo_rms import MongoRMS, MongoDAL, VERSION
from mongo_rms.errors import RMSException
def parse_args():
"""
parse command line arguments
:return:
"""
parser = argparse.ArgumentParser()
parser.add_argument(
'-c',
... | null | main.py | main.py | py | 2,351 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "mongo_rms.VERSION",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "yaml.load",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "yaml.SafeLoader",... |
400570000 | from curses import wrapper
import curses
import time
import pickle
# open the temp file which the value of health is stored in
op = open("shared.pkl", "rb")
import_health = pickle.load(op)
health = int(import_health["health"])
# closes the file again
op.close()
max_health = {
"civillian": 1000,
"warrior": 120... | null | GAME/status_window.py | status_window.py | py | 3,803 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "curses.initscr",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "curses.start_color",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "curses.init_pair",
"... |
131494858 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012-2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | null | __unported__/report_aeroo_ooo_plugin/plugin/OpenERP_Aeroo.py | OpenERP_Aeroo.py | py | 7,042 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
417725541 | import json
import sys
import psycopg2
def cleanStr4SQL(s):
return s.replace("'","`").replace("\n"," ")
def int2BoolStr (value):
if value == 0:
return 'False'
else:
return 'True'
def insert2BusinessTable():
#reading the JSON file
with open('yelp_business.JSON','r') as f: #TODO:... | null | milestone2/parseAndInsert_Sample copy.py | parseAndInsert_Sample copy.py | py | 11,538 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "psycopg2.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_... |
636166257 | import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from random import shuffle
with open("dlib/box_coordinates.csv") as f:
c = 0
lines = f.readlines()
shuffle(lines)
for line in lines:
name, x, y, height, width = line.split(",")
img = mpimg.imread("videos/"+name)
plt... | null | boundingbox.py | boundingbox.py | py | 607 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.shuffle",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.image.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.image",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
631644422 | from predictor import EnsembleBuilder
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route("/")
def hello():
return "go to /predict"
@app.route('/predict', methods = ['GET', 'POST'])
def predictor():
if(request.method == 'POST'):
rec_json = request.get_json()
... | null | application.py | application.py | py | 617 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "flask.request.get_... |
160517949 | from itertools import combinations
n,k = map(int,input().split())
teams = [list(map(int,list(input()))) for i in range(n)]
print("combination : " ,list(combinations(teams,2)))
sums = [sum([x[0] or x[1] for x in list(zip(*i))]) for i in combinations(teams,2)]
print(max(sums),sums.count(max(sums)),sep='\n')
# for i in... | null | team_submission.py | team_submission.py | py | 847 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.combinations",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 5,
"usage_type": "call"
}
] |
597250120 | from django.shortcuts import render
from . import forms
from django.http import HttpResponse
from app.models import Post
import requests
from django.utils import timezone
# Create your views here.
def blog(request):
try:
res = requests.get('https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random... | null | app/views.py | views.py | py | 1,440 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone.now",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "app.mode... |
277038730 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('menu', '0033_auto_20150722_1700'),
]
operations = [
migrations.AlterField(
model_name='shoppinglist',
... | null | menu/migrations/0034_auto_20150722_2237.py | 0034_auto_20150722_2237.py | py | 440 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterField",
"line_number": 14,
"usage_type": "call"
},
{... |
487558823 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from PIL import Image
import keras
from glob import glob
import cv2
from lib import *
import os
import segmentation_models as sm
import tensorflow as tf
def to_DataFrame(dir_image, dir_mask):
listd=os.listdir(f"/content/data/{dir_image}")
... | null | human_segmentation/lib/functions.py | functions.py | py | 5,725 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number":... |
73704089 |
import requests
from lxml import html
from bs4 import BeautifulSoup as bs4
from urllib.parse import urlsplit
from sys import exit
from io import open as iopen
import configparser
config = configparser.ConfigParser()
config_file = "wp.conf"
config.read(config_file)
DIR = config.get('config', 'directory')
PAGES... | null | wallpaper_get.py | wallpaper_get.py | py | 4,364 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "lxml.html... |
347698396 | import re
import json
class ilosc_slow_w_lyrics():
def __init__(self, nazwa_pliku):
self.nazwa = nazwa_pliku
def lyrics(self):
with open(self.nazwa) as file:
data = file.read()
self.slowa = re.findall('\w', data)
def ilosc_slow(self):... | null | 08-DataStructures/after class/24.py | 24.py | py | 1,223 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.findall",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 37,
"usage_type": "call"
}
] |
454668185 | import datetime
import difflib
import requests
import json
from django.shortcuts import (render_to_response, get_object_or_404)
from django.template.context import RequestContext
from django.http import (Http404, HttpResponseRedirect, HttpResponseBadRequest,
HttpResponse)
from django.conf import settings
from djan... | null | dpaste/views.py | views.py | py | 11,470 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "dpaste.forms.SnippetForm",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "dpaste.forms.SnippetForm",
"line_number": 42,
"usage_type": "call"
},
{
... |
279221117 | from django.contrib import admin
from django.urls import path
from home import views
# from django.conf.urls import url
# for customizing the admin panel
admin.site.site_header = "Quriosity Administration"
admin.site.site_title = "Quriosity Admin Panel"
admin.site.index_title = "Welcome to Quriosity.tech admin panel"
... | null | home/urls.py | urls.py | py | 1,872 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 8,
"usage_type": "attribute"
},
{
"a... |
74687938 | # -*- coding: utf-8 -*-
import logging
from bproject.models.models import (DBSession, Place)
from bproject.logic.cache import (memory_cache, five_seconds, one_hour)
from bproject.models.view import Return
log = logging.getLogger(__name__)
class PlacesFacade(object):
"""docstring for PlacesFacade"""
def __init... | null | bproject/models/facades/placesfacade.py | placesfacade.py | py | 3,957 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bproject.models.models.DBSession.query",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bproject.models.models.Place",
"line_number": 17,
"usage_type": "argument"
},
... |
533280021 | #-*- coding: utf-8 -*-
import os
from flask import Flask, request, redirect, url_for
from werkzeug import secure_filename
import time
from util.response import do_response
from db import ops
def get_user_info():
user = ops.get_user_by_user_id(request.user_id)
if not user:
return do_response(100,... | null | handler/user.py | user.py | py | 1,562 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db.ops.get_user_by_user_id",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "db.ops",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.request.user_id",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.re... |
198407318 | '''
Josh Jacobson
ATOC 5235, Homework 2 - Programming component
'''
import numpy as np
import pandas as pd
import scipy.stats as stats
import matplotlib.pyplot as plt
import seaborn as sns
## Problem 1
## -----------------------------------------------
## set parameters
n1 = 1.0+0j # refractive index air
n2 = 1.... | null | homework/.ipynb_checkpoints/hw2-checkpoint.py | hw2-checkpoint.py | py | 2,176 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "seaborn.set_style",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
72002969 | #!/usr/bin/env python
"""
Model to interact with customers.db
for use by all departments at HP Norton
pylintrc file: disabled - wildcard-import,
unused-wildcard-import, too-few-public-methods
"""
import logging
import pathlib
import peewee
from playhouse.shortcuts import model_to_dict
from customer_model import *
log... | null | students/adam_strong/lesson03/assignment/basic_operations.py | basic_operations.py | py | 4,536 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "playhouse.sho... |
55094072 | from telegram.ext import Updater, CommandHandler, Filters, MessageHandler
from QuerstellerBotUtils.Services.UserService import UserService
from QuerstellerBotUtils.Services.DatabaseService import DatabaseService
from QuerstellerBotUtils.Models.QuestionStates import QuestionStates
from QuerstellerBotUtils.Services impor... | null | src/main.py | main.py | py | 5,317 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "telegram.ext.Updater",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "QuerstellerBotUtils.Services.UserService.UserService",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "QuerstellerBotUtils.Services.DatabaseService.DatabaseService",
"lin... |
388878504 | #!/usr/bin/env python
import argparse
import os
import sys
import numpy as np
from gutils.readers.nc import m2m_nc_to_gutils_stream
from gutils.readers.dba import dba_to_stream
from gutils.readers import stream_to_yo
from gutils.yo import find_yo_extrema
from gutils.yo.filters import default_profiles_filter
from gutil... | null | gutils/utils/plot_yo.py | plot_yo.py | py | 2,765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gutils.readers.dba.dba_to_stream",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "gutils.readers.nc.m2m_nc_to_gutils_stream",
"line_number": 34,
"usage_type": "call"
... |
227870956 | # Create your views here.
from post.models import *
from django.shortcuts import redirect
import datetime
def del_post(request, post_id):
if not request.user.is_authenticated():
return redirect('/login/?next=%s' % request.path)
else:
Post.objects.filter(id = post_id).delete()
return redirect('/home/')
def... | null | post/views.py | views.py | py | 893 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.redirect",
"line_number": 17,
"usage_type": "call"
},
{
"api... |
145836388 | import pyecharts.options as opts
from pyecharts.charts import Candlestick
x_data = ["2017-10-24", "2017-10-25", "2017-10-26", "2017-10-27"]
y_data = [[20, 30, 10, 35], [40, 35, 30, 55], [33, 38, 33, 40], [40, 40, 32, 42]]
(
Candlestick(
init_opts=opts.InitOpts(
width="1440px",
heigh... | null | venv/Include/Day_04/Candlestick - Professional_kline_chart.py | Candlestick - Professional_kline_chart.py | py | 722 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyecharts.charts.Candlestick",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyecharts.options.InitOpts",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyecharts.options",
"line_number": 8,
"usage_type": "name"
},
{
"api_name":... |
497931150 | # -*- coding: utf-8 -*-
from flask import Flask, request
import pandas as pd
import numpy as np
import pickle
import flasgger
from flasgger import Swagger
app = Flask(__name__)
Swagger(app)
pickle_in_regressor = open('Regressor.pkl','rb')
pickle_in_standardScalar = open('StandardScalar.pkl', 'rb')
pickle_in_transf... | null | app.py | app.py | py | 2,499 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flasgger.Swagger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_numb... |
473892789 | from django.urls import path
from .views import WelcomeView, MenuView, get_ticket, erase_queue, processing, next_in_line
urlpatterns = [
path('', WelcomeView.as_view()),
path('welcome/', WelcomeView.as_view()),
path('menu', MenuView.as_view()),
path('get_ticket/<str:problem>', get_ticket),
path('e... | null | tickets/urls.py | urls.py | py | 417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.WelcomeView.as_view",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "views.WelcomeView",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.urls... |
369933772 | import MainNeuro
import scipy
import random
import time
import logging
import ipdb
nt = MainNeuro.network()
logging.basicConfig(format=u'%(levelname)-8s [%(asctime)s] %(message)s', level=logging.DEBUG, filename='log')
def initual(author):
if author is not '':
accentsTable = open(author+'/'+'accents')
... | null | main.py | main.py | py | 6,015 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "MainNeuro.network",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "random.randint"... |
362131295 | # Import
import json, os
from flask import Flask, request, Blueprint
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_jwt_extended import JWTManager, verify_jwt_in_request, get_jwt_claims
# Others
from datetime import timedelta
from f... | null | blueprints/__init__.py | __init__.py | py | 2,689 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask_jwt_extended.JWTManager",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_jw... |
248467448 | from django.forms import ModelForm
from second_try.models import *
from django.utils.translation import ugettext_lazy as _
# Create the form class.
class CallBackForm(ModelForm):
class Meta:
model = CallBack
fields = '__all__'
labels = {
'name': _('Ваше имя:'),
... | null | second_try/forms.py | forms.py | py | 1,154 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 12,
"usage_type": "c... |
179149430 | import random as rand
from Node import Node
import numpy as np
import cv2
class FrameConstructor:
def __init__(self, background, scale=1.0, shake_value=0.0, verbose=False):
self.VERBOSE = verbose
self.SCALE = scale
self.SHAKE_VALUE = shake_value
# add alpha channel if background d... | null | dataset_generator/FrameConstructor.py | FrameConstructor.py | py | 4,727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2RGBA",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "Node.Node",
"l... |
563766467 | # word2vec_model_test.py
# 이전에 만들어 둔 모델 파일을 읽어 와서 특정 단어와 유사한 단어들을 찾아 봅니다.
# 인접한 유사도를 이용하여 데이터를 시각화 해 봅니다.
from gensim.models import word2vec
import matplotlib.pyplot as plt
plt.rc('font', family='Malgun Gothic')
def showGraph(bar_graph):
length = len(bar_graph) # 요소 갯수
# x축에 보이는 글자
myticks = list(mydata... | null | Machine Learning/수업 자료/2주차_데이터 과학을 통한 자연어 처리와 통계학습/제09일차_word2vec_konlpy/word2vec_model_test.py | word2vec_model_test.py | py | 1,926 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.rc",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplot... |
221978454 | import argparse
import logging
import math
import random
import time
from typing import List, Optional
import datasets
import torch
import transformers
from accelerate import Accelerator
from datasets import load_dataset, load_metric
from torch.utils.data import DataLoader
from transformers import (
AdamW,
Ber... | null | man_ft.py | man_ft.py | py | 19,189 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Optio... |
117363653 | #!/usr/bin/python
# -*- coding: latin-1 -*-
# Python2.7
from gensim.models.keyedvectors import KeyedVectors as vDB
from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
#import numexpr as ne
import argparse
#import _pickle as pickle
import cPickle as pickle
import logging
import os
from functoo... | null | build/scripts-2.7/wisse_example.py | wisse_example.py | py | 8,466 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gensim.models.keyedvectors.KeyedVectors.load_word2vec_format",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "gensim.models.keyedvectors.KeyedVectors",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "logging.basicConfig",
"line_number"... |
506761749 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
NLUlite is a high-level Natural Language Understanding
framework.
This file is the client part of the framework. This file is released
with BSD license.
"""
__author__ = 'NLUlite'
__version__ = '0.1.12'
__license__ = 'BSD'
import socket, copy
import xml.etree.Elem... | null | client_python/NLUlite.py | NLUlite.py | py | 27,759 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.setdefaultencoding",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "HTMLParser.HTMLParser",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "HTMLParser.HTMLParser.__init__",
"line_number": 31,
"usage_type": "call"
},
{
"api_n... |
137145243 | import http.client
# from .serializers import UserSerializer
from django.http import HttpResponse
def send_sms(contact):
conn = http.client.HTTPSConnection("api.msg91.com")
payload = '{ \"sender\": \"TCNITR\", \"route\": \"4\", \"country\": \"91\", \"sms\": [ { \"message\": \"Tc Trial message\", \"to\": [ \"'... | null | workshop/api/sms.py | sms.py | py | 676 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "d... |
568386838 | import pygame
from src.core import Core
gb = Core()
# load bios
with open('rom/bios.gb', 'rb') as f:
byte = f.read(1)
index = 0
while(byte):
gb.memory[index] = int.from_bytes(byte, byteorder='little')
byte = f.read(1)
index += 1
print('bytes loaded', index)
black_color = (0,0,0)
white_color = (255,255,255... | null | main.py | main.py | py | 3,971 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "src.core.Core",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.init",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.display",
... |
89327360 | from setuptools import setup
def read(fname):
import os
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='oxyba',
version='0.30.0',
description='my wrapper functions and classes for python',
long_description=read('README.md'),
long_description_content_typ... | null | setup.py | setup.py | py | 766 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
212794099 | from mongoengine import Document, StringField, DateTimeField
from mongoengine import ReferenceField, ListField, EmbeddedDocumentField
from contasdoape.models.Usuario import Usuario
from contasdoape.models.Despesa import Despesa
from datetime import datetime
class Ape(Document):
nome = StringField()
convidados ... | null | contasdoape/models/Ape.py | Ape.py | py | 909 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mongoengine.Document",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "mongoengine.StringField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mongoengine.ListField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mongo... |
635469142 | # Standard Library
import sys
import datetime as dt
# Third party
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
# Custom
sys.path.append("/usr/local/airflow/dags/efs")
from admintools.scripts.install_python_deps import mai... | null | dags/InstallDependenciesProd.py | InstallDependenciesProd.py | py | 1,150 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "airflow.DAG",
"li... |
246591225 | # This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import json
import csv
import datetime
def get_file_content(path, write_to):
# Use a breakpoint in the code line belo... | null | main.py | main.py | py | 1,605 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
564706763 | #!/usr/bin/env python3
# -*- coding: utf-8 -*
import numpy as np
import matplotlib.pyplot as plt
import torch
from utils_torch import *
import utils
if __name__ == "__main__":
flag_fish = True
if not flag_fish:
lmk1 = np.random.rand(5, 2)
lmk2 = lmk1 + .1 * np.random.randn(5, 2)
else:
... | null | Geometrie/TP/TP2/codes/exo8.py | exo8.py | py | 1,392 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.rand",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",... |
600655002 | from tkinter import *
from tkinter.filedialog import askopenfilename
from PIL import Image, ImageTk
def picsend():
global f2
global f1
file = askopenfilename(defaultextension=".png",
filetypes=[("Image File", "*.png"), ("Text Documents", "*.jpg")])
image = Image.... | null | whatsapp_gui.py | whatsapp_gui.py | py | 2,805 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.filedialog.askopenfilename",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PIL.ImageT... |
469940643 | #Train on entire dataset
import os
import shutil
import pandas as pd
import numpy as np
from sklearn.preprocessing import MultiLabelBinarizer
from iterstrat.ml_stratifiers import MultilabelStratifiedKFold
import PIL
import fastai
from fastai.basic_train import _loss_func2activ
from fastai.vision import Path, ImageList,... | null | src/trainAll.py | trainAll.py | py | 5,586 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
472220062 | # Copyright (C) 2012 Alex Nitz, Josh Willis, Andrew Miller
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This p... | null | pycbc/waveform/bank.py | bank.py | py | 6,387 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pycbc.waveform.waveform.waveform_norm_exists",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pycbc.waveform.waveform",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pycbc.waveform",
"line_number": 41,
"usage_type": "name"
},
... |
328596105 | import numpy as np
from scipy import ndimage
import math
def moransI(grid, W):
if W.shape[0] != W.shape[1] or W.shape[0] % 2 == 0:
raise ValueError("Weight matrix must have equal and odd dimension (e.g., 5x5).")
M = ndimage.generic_filter(grid, getMoran, size=W.shape, extra_arguments=(W,))
return ... | null | MoransI.py | MoransI.py | py | 1,242 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.ndimage.generic_filter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
... |
1579417 | import datetime
import json
import http.client
import configparser
config = configparser.ConfigParser()
config.read('config_user.txt')
master_ip = config['CONFIGURATION']['MASTER_IP']
rq_id = config['CONFIGURATION']['rq_id']
number_of_clusters = config['CONFIGURATION']['number_of_clusters']
deployment_path = conf... | null | cluster_node/cluster/startup.py | startup.py | py | 1,690 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "http.cl... |
320241986 | from flask import request, make_response, jsonify
from main import app
from main.models import Device
from main.db_data_utils import get_devices_data
from main.api_auth import auth_required
@app.route("/resident/esp/get-devices/")
@auth_required
def get_resident_devices(current_user):
filtering = {}
filtering["flat... | null | home_server/main/device_routes/get_resident_devices.py | get_resident_devices.py | py | 1,851 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.request.args.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.re... |
166444660 | import discord
client = discord.Client()
@client.event
async def on_ready():
await client.send_message(client.get_channel('556498972475392000'), 'ข้ามาเฝ้าสะพาน Bifrost แล้ว')
@client.event
async def on_voice_state_update(before, after):
if before.voice.voice_channel != after.voice.voice_channel:
... | null | heimdall-bot.py | heimdall-bot.py | py | 805 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.Client",
"line_number": 3,
"usage_type": "call"
}
] |
591227719 | from ert.cwrap import CWrapper, BaseCClass
from ert.enkf import ENKF_LIB, EnkfStateType, EnkfFs
from ert.enkf.enums import EnkfInitModeEnum
from ert.util import BoolVector
class EnkfSimulationRunner(BaseCClass):
def __init__(self, enkf_main):
assert isinstance(enkf_main, BaseCClass)
super(EnkfSim... | null | devel/python/python/ert/enkf/enkf_simulation_runner.py | enkf_simulation_runner.py | py | 3,782 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ert.cwrap.BaseCClass",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "ert.cwrap.BaseCClass",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "ert.util.BoolVector",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "... |
113667052 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('shops', '0003_auto_20160327_0027'),
]
operations = [
migrations.AddField(
model_name='shops',
name='... | null | shops/migrations/0004_shops_general_cat.py | 0004_shops_general_cat.py | py | 491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
10306272 | #coding=utf-8
#作者:曾祥卫
#时间:2018.06.12
#描述:navbar-user用例集,调用user_business
import unittest, time
from navbar.user.user_business import UserBusiness
from dashboard.network_list.networklist_business import NetworkListBusiness
from access_points.aps_business import APSBusiness
from system.settings.settings_business import S... | null | testcase/testcase_user.py | testcase_user.py | py | 13,103 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "data.logfile.Log",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "data.data.data_basic",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "data.data",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "data.data.data_login"... |
435698376 | import numpy
import peakutils
from peakutils.plot import plot as pplot
from matplotlib import pyplot
import pylab
centers = (30.5, 72.3)
x = numpy.linspace(0, 120, 121)
y = (peakutils.gaussian(x, 5, centers[0], 3) +
peakutils.gaussian(x, 7, centers[1], 10) +
numpy.random.rand(x.size))
pyplot.figure(figsize=(1... | null | PeakDetection1.py | PeakDetection1.py | py | 639 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "peakutils.gaussian",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "peakutils.gaussian",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand... |
475295965 | ####################################
# Author: Ronald Cardenas
# Date: July 2017
# Project: Document Modeling with External Attention for Sentence Extraction
####################################
import sys
sys.path.append('../../common')
from sigopt import Connection
import math
import os
import random
import sys
imp... | null | answer_selection/xnet/sigopt_tunning.py | sigopt_tunning.py | py | 7,856 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.seed",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
591275518 | import theano as th
T=th.tensor
from ldlb.layer.base import TensorLayer
from ldlb.layer.linear import LinearLayer
class RecurrentLayer(TensorLayer):
def __init__(self, vmgr_, inp_shapes_, out_shapes_, scope_):
if type(self)==RecurrentLayer:
raise NotImplementedError('This class is abstract')
... | null | ldlb/layer/recurrent.py | recurrent.py | py | 5,474 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "theano.tensor",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "ldlb.layer.base.TensorLayer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "theano.config",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "ldlb.... |
409886437 |
import numpy as np
from gym import spaces
import tensorflow as tf
#return data,y_
def read_data(fileName, labelNum):
rf = open(fileName, "r")
rf.readline()
rf.readline()
buff = rf.readline()
data = []
y_ = []
while buff:
buff = buff.rstrip('\n')
a = buff.split()
b = ... | null | oneStock/myEnv.py | myEnv.py | py | 2,183 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.spaces.Box",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "gym.spaces",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
630464153 | from socket import *
from datetime import datetime
import json
import time
import argparse
def coder(dic):
return json.dumps(dic).encode('utf-8')
def decoder(byte):
return json.loads(byte.decode('utf-8'))
def presence():
return dict(action='presence', timestamp=datetime.timestamp(datetime.now()))
de... | null | lesson3/lesson3_client.py | lesson3_client.py | py | 1,232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.timestamp",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
513980956 | import asyncio
import websockets
import socket
import cv2
import struct
import numpy
MAX_BYTES = 65535
async def hello():
myName = socket.gethostname()
myIP = socket.gethostbyname(myName)
# 获取服务端地址
url = 'ws://' + myIP + ':9999/'
# 连接服务端
websocket = await websockets.connect(url)
websocket.... | null | video_test/videoClientTest1.py | videoClientTest1.py | py | 1,364 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "socket.gethostname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "websockets.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "cv2.destro... |
514429897 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 17 16:03:01 2019
@author: Li Xiang
correct the results for average elmo embedding
"""
import pandas as pd
import h5py
import numpy as np
df=pd.read_csv("../data/original_dataset.csv",encoding = "ISO-8859-1")
df=df.drop(df.columns[df.columns.str.contain... | null | Experiments/Elmo/test1.py | test1.py | py | 1,620 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "h5py.File",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_num... |
104993747 | import logging
class AWSTask:
def __init__(self, id, request, aws_access_key_id, aws_secret_access_key, logger=None):
self.aws_access_key_id = aws_access_key_id
self.aws_secret_access_key = aws_secret_access_key
self.task = request
self.id = id
self.result = dict()
... | null | omelet_boto/omelet_vg/eggs/aws/awstask.py | awstask.py | py | 688 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
}
] |
135976068 | try:
from setuptools import setup, find_packages
packages = find_packages()
extra_kwds = dict(
install_requires = ['Django>=0.96', 'PIL', 'markdown'])
except ImportError:
from distutils.core import setup
import os
packages = []
for root, dirs, files in os.walk('.'):
if '__ini... | null | pypi_install_script/Blogmaker-0.6.tar/setup.py | setup.py | py | 1,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.find_packages",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "distutils.core.setup",
... |
432982713 | #- Python 3 source code
#- qq-wait-times-dormant-bin2.py ~~
#
# This program creates a Quantile-Quantile plot (or more accurately here, a
# Percentile-Percentile plot) of the distributions for the wait times of
# bin 2 jobs submitted by non-CSC108 projects during the two weeks prior to
# the "dormant" period... | null | analysis/qq-wait-times-dormant-bin2.py | qq-wait-times-dormant-bin2.py | py | 4,656 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.percentile",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "matplotlib... |
340638164 | import Hamiltonian
import matplotlib.pyplot as pyplot
import scipy.constants
import numpy
import time
import os
from jqc import jqc_plot
from scipy import sparse
jqc_plot.plot_style('Large')
cwd = os.path.dirname(os.path.abspath(__file__))
B = 0
I = 0
E = 0
Beta = 0
h = scipy.constants.h
muN = scipy.constants.physic... | null | test_output.py | test_output.py | py | 2,383 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jqc.jqc_plot.plot_style",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "jqc.jqc_plot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
507564715 | from sentence_transformers import SentenceTransformer, util
import json
import logging
from django.http import HttpRequest, HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
import requests
from lxml import html
import trafilatura
from urllib.parse import urlparse
logger = logging.getLogg... | null | api/views.py | views.py | py | 1,858 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sentence_transformers.SentenceTransformer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.http.HttpRequest",
"line_number": 18,
"usage_type": "name"
},
{
... |
124975762 | import seaborn as sns
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
counter = [0, 0, 0, 0, 0, 0]
sleep_count = [0 for i in range(24)]
height1 = 0
height2 = 0
number1 = 0
number2 = 0
BMI1 = 0
BMI2 = 0
with open('data/N... | null | .ipynb_checkpoints/lesson4-checkpoint.py | lesson4-checkpoint.py | py | 1,459 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 5,
"usage_type": "attribute"
},
{
"ap... |
553998569 | from module.hdfs_dir_list import get_hdfs_list as ghl
from pyspark.sql import SparkSession
import pandas as pd
import numpy as np
def get_data(path):
data_list=[]
data_s=ghl(path)
ss=SparkSession.builder.appName("get_data").getOrCreate()
for d in data_s:
p=str(d)[1:].replace("'",'')
if p... | null | B_source/python_master/more/module/Get_HDFS.py | Get_HDFS.py | py | 2,504 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "module.hdfs_dir_list.get_hdfs_list",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder.appName",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.SparkSession.builder",
"line_number": 8,
"usage_typ... |
286241500 | from django.contrib.auth.models import User
from rest_framework import serializers, viewsets
from .models import Student, Tutor
class UserSerializer(serializers.ModelSerializer):
"""
Serializer that Django Rest Framework uses to serialize the User
models.
"""
class Meta:
model = User
... | null | profiles/serializers.py | serializers.py | py | 2,419 | python | en | code | null | code-starcoder2 | 76 | [
{
"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": "django.contrib.auth.models.User",
"line_number": 12,
"usage_type... |
501893056 | import efweb.web
import asyncio
@efweb.web.middleware
async def error_middleware(request, handler):
if request.method == 'POST' and request.content_type != 'application/json':
return efweb.web.json_response({'error': 'Request data must be a json type.'})
response = await handler(request)
return re... | null | efweb/example/test.py | test.py | py | 1,319 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "efweb.web.web.json_response",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "efweb.web.web",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "efweb.web",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "efweb.web.web",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.