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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
447397564 | from ....schema import Schema
from ....exc import InvalidOperationError
from enum import Enum, auto
class SchemaType(Enum):
CATALOG = auto()
SCHEMA = auto()
class Dialect:
"""
A generic SQL dialect attempting to conform to the SQL standard rather than any particular DBMS. This can be used
when t... | null | ormr/drivers/sql/dialects/generic.py | generic.py | py | 2,899 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "schema.Schema",
"line_number": 19,
... |
22839791 | from django.shortcuts import render_to_response
from django.template import RequestContext
from blog.models import BlogData
from login import userlogin
def index(request):
blogtoplist = list(BlogData.objects.all().order_by('-id')[:10])
return render_to_response("blog/index.html",
{
"blogtoplis... | null | blog/views.py | views.py | py | 1,062 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "blog.models.BlogData.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "blog.models.BlogData.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "blog.models.BlogData",
"line_number": 7,
"usage_type": "name"
},
{
... |
499193655 | """empty message
Revision ID: dadec3d6230a
Revises: 8a60cf7d738c
Create Date: 2020-02-12 15:44:34.235426
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dadec3d6230a'
down_revision = '8a60cf7d738c'
branch_labels = None
depends_on = None
def upgrade():
# ... | null | xivtools.db/migrations/versions/dadec3d6230a_.py | dadec3d6230a_.py | py | 966 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "alembic.op.create_table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integ... |
626465780 | #! /usr/bin/env python
# all constants containing a value "set to ..." are to be customized
#
import smtplib, sys, datetime, time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import datetime, glob, os
EMAIL_EDITOR_FROM = "dft-no-reply@evidenceproject.eu"
EMAIL_EDITOR_FROM_NAME =... | null | tools/default.dfte.send.mail.ssl.approval.py | default.dfte.send.mail.ssl.approval.py | py | 2,348 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "datetime.datetime.today",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.getcw... |
578273215 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
from astropy.io import fits
from astropy.time import Time
from PyAstronomy import pyasl
from scipy import ndimage
import pandas as pd
import gaussfitter as gf
import BF_functions as bff... | null | rvs/BFgaussout.py | BFgaussout.py | py | 22,498 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "BF_functions.user_rc",
"line_number": 201,
"usage_type": "call"
},
{
"api_name": "BF_functions.logify_spec",
"line_number": 212,
"usage_type": "call"
},
{
"api_name": "BF_functions.read_specfiles",
"line_number": 215,
"usage_type": "call"
},
{
"api_... |
318541348 | '''
Created on 5 janv. 2016
@author: Nicolas R
'''
from django.shortcuts import render
from blindtest import context_processor
def render_page(request, template_name, data = {}, static_js_files = [], static_css_files = [], ext_js_files = [], ext_css_files = []):
context = context_processor.common(request)
... | null | blindtest/ui/utils.py | utils.py | py | 1,194 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "blindtest.context_processor.common",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "blindtest.context_processor",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
}
] |
382722640 | import serial #import serial library
import numpy #import numpy
import matplotlib.pyplot as plt #import matplotlib library
from drawnow import *
import array as arr
dist = [] #an array to put the arduino information before print
arduinoData = serial.Serial('/dev/ttyACM0', 115200) #comunication with Arduino Serial
... | null | pendulo/ultrassom-plt_V3.py | ultrassom-plt_V3.py | py | 775 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "serial.Serial",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplo... |
175445864 | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 4 16:01:48 2022
@author: bdobson
"""
from wsimod import nodes
from wsimod.arcs import arcs as arcs_mod
from tqdm import tqdm
from wsimod.nodes.land import ImperviousSurface
from wsimod.core import constants
from wsimod.core.core import WSIObj
from wsimod.nodes.nodes impo... | null | wsimod/orchestration/model.py | model.py | py | 42,982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "datetime... |
565670345 | # -*- coding: utf-8 -*-
"""
Created on Fri May 31 10:21:53 2019
@author: SEBASTIAN LAVERDE
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import random
mars01 = cv2.imread("hirise-map-proj-v3/map-proj-v3/ESP_011283_2265_RED-0013.jpg", 1)
mars01_gray = cv2.cvtColor(... | null | image_segmentation/ImageSegmentation.py | ImageSegmentation.py | py | 3,584 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "cv2.Canny",
"line... |
543136763 | from comet_ml import Experiment # must be imported before keras
import numpy as np
import pandas as pd
import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential, load_model
from keras.layers import Flatten, Dense, Dropout, Conv2D, MaxPooling2D, UpSampling2D
from keras.op... | null | models/resnet96_128/train.py | train.py | py | 3,830 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tensorflow.ConfigProto",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "comet_ml.Experiment",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.... |
34480743 | from BTrees.OOBTree import OOBTree
from copy import copy
from datetime import datetime
from opengever.base.pathfinder import PathFinder
from opengever.base.sentry import log_msg_to_sentry
from plone import api
from plone.portlets.constants import CONTEXT_ASSIGNMENT_KEY
from plone.protect.auto import ProtectTransform
fr... | null | opengever/base/protect.py | protect.py | py | 10,157 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "zope.annotation.attribute.AttributeAnnotations",
"line_number": 48,
"usage_type": "argument"
},
{
"api_name": "plone.protect.auto.safeWrite",
"line_number": 55,
"usage_type": "cal... |
167662047 | import sys
#sys.stdin=open("input.txt",'rt') # 경로 잡고, 파일 엵음. read a file as text
from collections import deque
dq=deque()
dq.append((0,0))
dx=[-1,0,1,0]
dy=[0,1,0,-1]
n=7
board=[]
for i in range(n):
board.append(list(map(int,input().split())))
res=[[0]*n for _ in range(n)] # 있으면 안뻗을꺼임.
while dq:
... | null | Self_study/2020_Winter/2. Algorithms with Python/파이썬 알고리즘 문제 및 채점/섹션7. 깊이, 넓이 우선탐색(DFS, BFS) 활용/9. 미로의 최단거리 통로/AA.py | AA.py | py | 840 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
152649808 | import sys
from PyQt5 import uic
from recommend import Recommend
from complain import Complain
from profil import Profil
from PyQt5.QtWidgets import QApplication, QMainWindow
class Main(QMainWindow):
def __init__(self, parent=None):
super().__init__()
uic.loadUi('main.ui', self)
self.init... | null | main.py | main.py | py | 1,567 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.uic.loadUi",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PyQt5.uic",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "recommend.Reco... |
425086863 | import pybullet as p
from time import sleep
import pybullet_data
import numpy as np
physicsClient = p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.resetSimulation(p.RESET_USE_DEFORMABLE_WORLD)
p.setGravity(0, 0, -10)
planeId = p.loadURDF("plane.urdf", [0,0,-2])
#boxId = p.loadURDF("cube.... | null | examples/pybullet/examples/soft_body_data.py | soft_body_data.py | py | 2,832 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pybullet.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pybullet.GUI",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pybullet.setAdditionalSearchPath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pybu... |
370266890 | #!/usr/bin/env python
# coding=utf-8
from flask import render_template, request, Response, redirect, url_for, Blueprint,abort
from flask.ext.login import login_required
from datetime import date, datetime
import flaskcms.config as myconfig
import math
import ast
import os
import time
import json
from flask.views import... | null | flaskcms/view/admin.py | admin.py | py | 3,300 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flaskcms.view.CommonView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "flask.abort",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "flask.ext.... |
390002150 | import netCDF4
from netCDF4 import Dataset
import numpy as np
import datetime
import rioxarray, rasterio, xarray as xr
from osgeo import gdal
from rasterio.control import GroundControlPoint as GCP_r
from gdal import GCP as GCP_g
from rasterio.control import GroundControlPoint as GCP_r
import cv2
from affine import Affi... | null | basics_and_concatenating.py | basics_and_concatenating.py | py | 3,439 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "netCDF4.Dataset",
... |
169424338 | # coding: utf-8
"""
Redactium III -> Base Forms
Типовые базовые формы
Skillholders LLC, 2014
skillholders.com | michael@drozdovsky.com
"""
from django import forms
class ReForm(forms.Form):
"""
Базовый класс легковесной формы для модели
"""
# ID объекта (раз у нас форма для модели)
id = forms.Int... | null | ephemeris/back/base/forms.py | forms.py | py | 3,758 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.Form",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.forms.IntegerField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.... |
239954873 | from apscheduler.schedulers.background import BackgroundScheduler
import datetime
import importlib
import gatt
import logging
import yaml
import subprocess
logging.basicConfig(filename='/var/log/turntouch.log',
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
dat... | null | monitor.py | monitor.py | py | 5,877 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "gatt.DeviceMan... |
532264254 | import torch
import os
import sys
import torch
from torchvision.transforms import functional as F
from torch.utils.data import DataLoader
sys.path.append('/u/bryao/work/Documents/deeplabv3/utils')
from PIL import Image
import cv2
import glob
from build_samplers import make_data_sampler, make_batch_data_sampler
import ... | null | datasets/a3d.py | a3d.py | py | 2,620 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.utils",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.tensor",
"line... |
515472616 |
"""pandas, seaborn, sklearn utils
This is an independent util script.
source activate py2
"""
import re
from glasbey import Glasbey
import plotly.graph_objs as go
import plotly.io as plio
import plotly.express as px
import plotly
plotly.io.orca.config.executable = "/home/yli11/.conda/envs/py2/bin/orca... | null | utils/liyc_utils.py | liyc_utils.py | py | 13,885 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "plotly.io",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "plotly.io.orca",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "plotly.io",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "matplotlib.use",
"li... |
579220899 | """Profile class"""
import re
from bs4 import BeautifulSoup
from rival_regions_wrapper import functions
class Overview():
"""Wrapper class for perks"""
def __init__(self, api_wrapper):
self.api_wrapper = api_wrapper
def info(self):
"""Get perks"""
path = 'main/content'
... | null | src/rival_regions_wrapper/api_wrapper/overview.py | overview.py | py | 2,416 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "rival_regions_wrapper.functions.parse_date",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "r... |
369864178 | import os
from bs4 import BeautifulSoup as beautifulsoup
import random
import urllib.request as urllib_request
import sys
import lxml
import winter_cat_url_control.url_put as put
import winter_cat_fake_user_box.fake_headers as fake_headers
def get_search_link(url):
if url is None:
headers = {'User-Agent':... | null | winter_cat_research/link_research.py | link_research.py | py | 1,509 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "winter_cat_fake_user_box.fake_headers.get_fake_headers",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "winter_cat_fake_user_box.fake_headers",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "urllib.request.Request",
"line_number": 14,
... |
107816243 | """Запуск запуск сервера и клиента MongoDB и соединения с интернетом."""
import atexit
import functools
import logging
import subprocess
from typing import Tuple
import psutil
import pymongo
import requests
from requests import adapters
from poptimizer import config
# Максимальный пул соединений по HTTPS и повторных... | null | poptimizer/store/mongo.py | mongo.py | py | 5,958 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "psutil.process_iter",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "poptimizer.config.MONGO_PATH.mkdir",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "poptimizer.config.MONGO_PATH",
"line_number": 48,
"usage_type": "attribute"
},
... |
199498559 | import sqlite3
from selenium import webdriver
import time
import random
import unicodedata
import re
from pytube import YouTube
#МОдуль для получения ссылок на видео
def save_link_in_db_from_channel(chan_for_download, number_of_scrolling):
# создание пустой базы данных
# number_of_scrolling = 10
# print(... | null | download_videos_from_channels.py | download_videos_from_channels.py | py | 4,332 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "selenium.webdriver.ChromeOptions",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 21,
"usage_type": "call"
},
{
"api... |
339161831 | import cv2
import numpy as np
import logging
import math
import datetime
import threading
import _thread
import time
import serial
import traceback # TODO remove
import pyrealsense2 as rs
import sys
from cam import setupstream
from cam import getframes
_SHOW_IMAGE = True
# CONSTANTS
yellow_... | null | Stolen_vision_2.py | Stolen_vision_2.py | py | 38,501 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "time.sleep",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 99,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": ... |
216779028 | #!/usr/bin/env python3
import math
import sys
import argparse
import numpy as np
import tensorflow as tf
import multiprocessing as mp
from functools import partial
from Bio.PDB import *
weights = {'C':12.011, 'N':14.007, 'O':15.999, 'S':32.06}
allowed_atoms = ['N','CA','C','O','OXT','CB',
'CZ','CZ... | null | src/protocol_gramm.py | protocol_gramm.py | py | 15,686 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tensorflow.Session",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "tensorflow.Session",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool... |
349289287 | import torch
from H36M import Task
class Config(object):
def __init__(self):
self.annotation_path = "./Human3.6M/annot"
self.image_path = "./Human3.6M/images"
self.pretrained_path = "./pretrained/"
self.subjects = [1, 5, 6, 7, 8, 9, 11]
self.task = Task.Train
self.... | null | config.py | config.py | py | 604 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "H36M.Task.Train",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "H36M.Task",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",... |
602785111 | from __future__ import print_function
import sys, os.path, glob, json
from time import sleep
import requests, urllib2, httplib
from io import BytesIO
from PIL import Image, ImageFile
import numpy as np
AGENT = {'Api-User-Agent': 'WikiFaces/1.0 (https://github.com/apoorvkh/WikiFaces; ak2254@cornell.edu)'}
info_files =... | null | scripts/wiki_scrape/primary_image_scrape.py | primary_image_scrape.py | py | 4,444 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 38,
... |
299041657 | """The Flask App
"""
import os
from uuid import uuid4
from datetime import datetime
from flask import Flask, request, session, abort, redirect, g, url_for, flash
from flaskext.genshi import Genshi, render_response
from flask import json
from werkzeug.contrib.fixers import ProxyFix
from openhdi.mongo import get_db
imp... | null | openhdi/app.py | app.py | py | 6,938 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_... |
609379353 | #!/usr/bin/python2.7
"""This is script to check a lofasm files and output a file information file.
"""
if __name__=='__main__':
import numpy as np
import argparse
import os
from lofasm.file_info import LofasmFileInfo
parser = argparse.ArgumentParser(description="Lofasm check file tool")
parse... | null | bin/lofasm_check_files.py | lofasm_check_files.py | py | 1,548 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lofasm.file_info.LofasmFileInfo",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "lofasm.file_info.LofasmFileInfo",
"line_number": 23,
"usage_type": "call"
},
... |
539323002 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
"""A simulation of co-evolution of prey and predator(birth、death、competition
and de novo mutation) using Gillespie Algorithm.
* This version is for drawing a picture of stochastic co-evolutionary dynamics
of the prey and... | null | Uniform Distribution Model/ud_pic.py | ud_pic.py | py | 11,243 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.random.random_sample",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random_sample",
"line_number": 107,
"usage_type": "call"
},
{
"api_name... |
327664636 | from _ctypes import Structure, POINTER
from contextlib import contextmanager
from ctypes import cdll, c_char_p, c_int32
from pathlib import Path
dylib_dir = Path(__file__).parent / "dylib"
dylib_path = list(dylib_dir.glob("libsnips_nlu*"))[0]
lib = cdll.LoadLibrary(str(dylib_path))
@contextmanager
def string_pointer... | null | platforms/python/snips_nlu_rust/utils.py | utils.py | py | 539 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "ctypes.cdll.LoadLibrary",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ctypes.cdll",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "contextlib.contextmanag... |
259110264 | import numpy as np
import pytest
from simulator.circuit import Circuit
from simulator.backend.stabilizer import run as run_stabilizer
from simulator.backend.statevector import run as run_statevector
from simulator.backend.tableau import run as run_tableau
from simulator.backend.chtableau import run as run_chtableau
@... | null | test/integration/test_ghz_game.py | test_ghz_game.py | py | 1,077 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "simulator.circuit.Circuit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.isclose",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pytes... |
293104004 | # -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | null | script.module.placenta/lib/resources/lib/modules/utils.py | utils.py | py | 1,781 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 42,
"usage_type": "call"
}
] |
116427682 | from kivy.uix.screenmanager import Screen
from kivy.uix.boxlayout import BoxLayout
from kivy. uix.gridlayout import GridLayout
from kivy.uix.spinner import Spinner
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.textinput import TextInput
from kivy.uix.... | null | janelas/first_screen.py | first_screen.py | py | 4,491 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "kivy.uix.boxlayout.BoxLayout",
"line_number": 25,
"usage_type": "call"
},
{... |
621066627 | """
Pre-training the place cell
Model
lstm with one hidden layer
I don't know if truncated BPTT or gradient clip are necessary here
"""
import argparse
import math
import sys
import time
import random
import pickle
import datetime
import numpy as np
import six
import matplotlib.pyplot as plt
import chainer
from cha... | null | trainer/visual_predictive_place_cell/train_practice_diff_layers_shortened_plot_fig2.py | train_practice_diff_layers_shortened_plot_fig2.py | py | 8,366 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "chainer.cuda.cupy",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "chainer.cuda",
"line_number": 57,
"usage_type": "name"
},
{
"api_name": "dataset_g... |
541617645 | import sys
import logging
import pymysql
import json
import requests
import time
from datetime import datetime
hostname = 'ejercicio2-instancia.cryssnu9ajdn.us-east-2.rds.amazonaws.com'
username = 'ejercicio2admin'
password = '8XLY3NHHU6WH6ODZMCDj'
dbname = 'ejercicio2db'
logger = logging.getLogger()
lo... | null | ejercicio_2/lambda_function.py | lambda_function.py | py | 2,241 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pymysql.connect",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pymysql.MySQLErro... |
18281825 | from django.contrib.auth import get_user_model
from actstream import action
from rest_framework import serializers
from control.models import Control
from .models import UserProfile
User = get_user_model()
class RemoveControlSerializer(serializers.Serializer):
control = serializers.PrimaryKeyRelatedField(que... | null | user_profiles/serializers.py | serializers.py | py | 2,998 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 14,
"usage_type... |
226655453 | from django.conf.urls import patterns, include, url
from core import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^impressum/$', views.static, {'site' : 'impressum.html'}, name='impressum'),
url(r'^presse/$', views.static, {'site' : 'presse.html'}, name='presse'),
url(r'^konzept/$... | null | core/urls.py | urls.py | py | 1,044 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "core.views.index",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cor... |
230098156 | from django.http import HttpResponseBadRequest
class ModelView(object):
u"""
A generic view for models which can recieve GET and POST requests
The __init__ method of subclasses should set the default response
variable.
"""
template_file = None
response = None
def __call_... | null | oscar/view/generic.py | generic.py | py | 1,472 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.http.HttpResponseBadRequest",
"line_number": 25,
"usage_type": "call"
}
] |
283917762 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty, NumericProperty, ListProperty, BooleanProperty, OptionProperty, \
ReferenceListProperty, StringProperty
from kivy.graphics import Color, Triangle, Rectangle, Ellipse, Line, InstructionGroup
from kivy.uix.image im... | null | main.py | main.py | py | 30,829 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "kivy.lang.Builder.load_string",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Builder",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "kivy.uix.widget.Widget",
"line_number": 199,
"usage_type": "name"
},
{
"api_name"... |
38670664 | from django.conf.urls import url
from django.conf.urls import include
from linkmanager import views
from django.contrib.auth import views as auth_views
urlpatterns =[
url(r'^dashboard/', views.Dashboard, name='dashboard'),
url(r'^about', views.about, name='about'),
url(r'^contact', views.contact, name='... | null | linkmanager/urls.py | urls.py | py | 1,688 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "linkmanager.views.Dashboard",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "linkmanager.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "... |
614137568 | import sys
import os
import re
import subprocess
import argparse
parser = argparse.ArgumentParser(description='Gitforward helps you step easily from one commit to another, using a few simple directives.')
parser.add_argument('-n', '--next', dest='next', action='store_const', const='next', help='Next commit')
parser.... | null | gitforward.py | gitforward.py | py | 9,717 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
... |
509941835 | #import pygtk
#pygtk.require('2.0')
#import gtk
import gobject
import pygst
pygst.require('0.10')
gobject.threads_init()
import gst
import time
class Listen(object):
def __init__(self):
self.voice = False
self.lock = False
self.init_gst()
def init_gst(self):
"""Initial... | null | listen_test.py | listen_test.py | py | 4,031 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pygst.require",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gobject.threads_init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "gst.parse_launch",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "gst.STATE_PAUSED",
... |
582657459 | from django.utils import timezone
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect, render, get_object_or_404
from django.views import View
from django.views.generic import TemplateView
from users.models import UserProfile
from .models... | null | tweety/views.py | views.py | py | 2,029 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.views.generic.TemplateView",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.views.View",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "models.Tweet.objects.filter",
"line_number": 19,
"usage_type": "call"
},
{
"a... |
426311405 | #! python
# -*- coding:utf-8 -*-
import os
import sys
import json
from xml.dom.minidom import Document
try:
basestring
except NameError:
basestring = str
try:
long
except NameError:
long = int
# python3中没有unicode了
try:
unicode
except NameError:
unicode = str
# 加上不确定的层级缩进,60比较合适
BASE_LENGTH ... | null | writer.py | writer.py | py | 9,202 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.dumps",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "xml.dom.minidom.Document",
"line_number": 147,
"usage_type": "call"
}
] |
538449215 | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 1 15:45:34 2017
Triadiagonal matrix algorithm/Thomas algorithm
Tx = b
Same as Gauss elimination ,
except coefficient matrix is tridiagonal
@author: Nikhil Yewale
"""
from IPython import get_ipython
get_ipython().magic('reset -sf')
import numpy as np
def TDMA(... | null | TDMA algorithm.py | TDMA algorithm.py | py | 1,264 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "IPython.get_ipython",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.sparse.spdiags",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "scipy.spa... |
222099727 | # --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import random
import socket
import struct
import six
import threading
from thrift.transport import TTranspo... | null | nebula/ngMeta/MetaClient.py | MetaClient.py | py | 15,921 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "six.PY3",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "threading.Timer",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "threading._Timer",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "meta.ttypes.E... |
554855756 | import logging
import time
import traceback
from datetime import datetime, timedelta
from pathlib import Path
import numpy as np
import pandas as pd
import xarray as xr
from glob import glob
from motu_utils.utils_cas import authenticate_CAS_for_URL
from motu_utils.utils_http import open_url
from siphon import http_uti... | null | weather.py | weather.py | py | 22,576 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "check_connection.CheckConnection.set_url",
"line_number": 58,
"usage_type": "call"
},
{
"api_... |
520903612 | import scrapy
class ContributorsSpider(scrapy.Spider):
name = "contributors"
def start_requests(self):
urls = [
'https://challenges.openideo.com/challenge/combatzikafuturethreats/research',
'https://challenges.openideo.com/challenge/future-of-highered/research',
'https://challenges.openideo.com/challenge/fi... | null | OpenIDEOSpider/spiders/Contributors.py | Contributors.py | py | 1,735 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scrapy.Spider",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
... |
646772027 |
import unittest
from ..api.model import Model, Field, DatetimeField
from ..api.model.utils import from_fields
import datetime
import gc
class ModelInheritanceCase(unittest.TestCase):
def setUp(self):
class User(Model):
name = Field(str)
self.User = User
def test_simple_model(sel... | null | eta/tests/test_model.py | test_model.py | py | 6,779 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "api.model.Model",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "api.model.Field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "unittest.TestCa... |
30407902 | #!/usr/bin/env python3.6
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from orm_setup import Base, Caso
from oauth2client.client import flow_from_clientsecrets
from oauth2client.client import FlowExchangeError
import httplib2
import json
from flask import make_response
import requests
fro... | null | run.py | run.py | py | 17,651 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "orm_setup.Base.metadata",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "orm... |
209374747 | import pandas as pd
from sklearn.datasets import make_classification
def get_test_data(n_features=40, n_informative=10, n_redundant=10, n_samples=10000):
X, cont = make_classification(n_samples=n_samples, n_features=n_features,
n_informative=n_informative, n_redundant=n_redundant... | null | datasets.py | datasets.py | py | 982 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sklearn.datasets.make_classification",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DatetimeIndex",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.tseries.offsets.BDay",
"line_number": 9,
"usage_type": "call"
},
{
... |
565630867 | import matlab.engine
import os
import logging
from tqdm import tqdm
from torch.autograd import Variable
import torch.nn.functional as F
from torchvision.utils import save_image
import torch
import utils
import scipy.io as io
import numpy as np
from sklearn.decomposition import PCA
import random
import logger
Tensor = ... | null | train_and_evaluate.py | train_and_evaluate.py | py | 17,317 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.FloatTensor",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.... |
178625929 | """
Team Sleep Deprived: Victoria Gao, Renee Mui, Anya Zorin
SoftDev
K13 -- Template for Success
2020-10-19
"""
from flask import Flask, render_template
import csv, random
app = Flask(__name__)
@app.route("/")
def hello():
return "No hablo queso!"
@app.route("/occupyflaskst")
def get_job():
... | null | 13_tempwork/app.py | app.py | py | 1,395 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"li... |
20983452 | # -*- coding: utf8 -*-
import os
import unittest
from appium import webdriver
from time import sleep
directory = '%s/' % os.getcwd()
class IosDeviceTests(unittest.TestCase):
"ios device测试用例"
def setUp(self):
"Setup for the test"
desired_caps = {}
desired_caps['platformName'] = 'iOS'
... | null | tests/appium_test_ios_device.py | appium_test_ios_device.py | py | 999 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_n... |
599078195 | import numpy as np
import os
import matplotlib
matplotlib.use('agg')
import matplotlib.dates as mpd
from watchtower import commits_
import matplotlib.pyplot as plt
from tqdm import tqdm
import calendar
import pandas as pd
import traceback
def count_doc_commits(user, project, search_queries=None,
... | null | src/watchtower/plot_commits.py | plot_commits.py | py | 4,921 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.datetime.today",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pandas.datetim... |
483279032 | import discord
import asyncio
import pickle
import logging
import time
class area():
def __init__(self):
self.areaName = '???'
self.areaDescription = '''in the abyss of nothingness you are all, and all is you.
And yet...
You can\'t seem to shake the feeling that you are not alone'''
class ... | null | diBot.py | diBot.py | py | 3,488 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "discord.Client",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_numb... |
262006952 | # Interpolacion de Lagrange
# Polinomio en forma simbólica
import numpy as np
import sympy as sym
import matplotlib.pyplot as plt
# INGRESO , Datos de prueba
# Conjunto x
conj_x_1 = float(input(" Conjunto X punto 1: "))
conj_x_2 = float(input(" Conjunto X punto 2: "))
conj_x_3 = float(input(" Conjunto X punt... | null | metodosMatematicos/expo/polynomial.py | polynomial.py | py | 1,708 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sympy.lambdify",
"line_numbe... |
626302394 | import socketserver
import json
import configparser
import os
from conf import settings
STATUS_CODE = {
1: "verify success",
2: "verify failed",
3: "file exist",
4: "file exist,but not complete",
5: "file not exist"
}
class ServerHandler(socketserver.BaseRequestHandler):
def handle(self):
... | null | FTP_server/core/server.py | server.py | py | 4,713 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "socketserver.BaseRequestHandler",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "configparser.ConfigParser",
"line_number": 46,
"usage_type": "call"
},
{
"api_nam... |
315408774 | # _*_ coding:utf-8 _*_
# def1
import requests
import re
import time
import os
import json
# import jihua_2008cai
import cookie_yang
import shenjihua
# import jihuaapk
# 登陆headers_bets
headers={
'User-Agent':"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535... | null | jihua_more13-20180416/bjpk10/login.py | login.py | py | 8,913 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.Session",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cookie_yang.save_cookies_lwp",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.strftim... |
488170646 | import warnings
warnings.filterwarnings('always')
import numpy as np
import pandas as pd
import gc
import os
from pathlib import Path
from ast import literal_eval
from collections.abc import Mapping
from sklearn.model_selection import train_test_split, StratifiedKFold, RandomizedSearchCV
from sklearn.linear... | null | NestedCV_flareCME_v01.py | NestedCV_flareCME_v01.py | py | 13,106 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
... |
284733767 | from cgl.plugins.Qt import QtCore, QtGui, QtWidgets
import logging
import threading
import time
from cgl.core.config.config import ProjectConfig
class ProgressGif(QtWidgets.QWidget):
def __init__(self, title='CG Lumberjacking...', height=150, cfg=None):
QtWidgets.QWidget.__init__(self)
layout = Q... | null | cgl/ui/widgets/progress_gif.py | progress_gif.py | py | 2,977 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cgl.plugins.Qt.QtWidgets.QWidget",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cgl.plugins.Qt.QtWidgets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "cgl.plugins.Qt.QtWidgets.QWidget.__init__",
"line_number": 11,
"usage_type":... |
24379017 | import typing
import random
import numpy as np
from numpy.lib.stride_tricks import as_strided
import pandas as pd
import matplotlib.pyplot as plt
import cv2
action_num = 4
overlay_num = 1
ma_kernel_sizes = np.array([5, 15, 31, 61], np.int64)
ma_kernel_size_halfs = ma_kernel_sizes // 2
ma_kernels = [np.ones(size) / si... | null | cpf/python/training/auto_trade/trade_environment.py | trade_environment.py | py | 14,583 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.int64",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "numpy.ones",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number... |
621293821 | # importing dependencies
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import cv2
from keras.models import model_from_json
from keras.preprocessing import image
import base64
model = model_from_json(open("fer.json", "r").read())
model.load_weights('fer.h5')
face_haar_cascade = cv2.CascadeClassifier(cv2.data.haarc... | null | cam.py | cam.py | py | 1,962 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "keras.models.model_from_json",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.... |
161769567 | # -*- coding:utf-8 -*-
'''
@author: misldy
'''
import unittest
from appium import webdriver
platformName = "Android"
deviceName = "K120180523001"
platformVersion = "7.1.2"
appPackage = "com.sunmi.ota"
appActivity = "com.sunmi.ota.ui.activity.UpgradeActivity"
class LoginAndroidDriver(unittest.TestCase):... | null | src/lAppium/test/case3.py | case3.py | py | 747 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "appium.webdriver.Remote",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "appium.webdriver",
"line_number": 23,
"usage_type": "name"
}
] |
220538042 | """
byceps.blueprints.admin.seating.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask import abort, request
from ....services.party import service as party_service
from ....services.seating import (
area_se... | null | byceps/blueprints/admin/seating/views.py | views.py | py | 2,838 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "util.framework.blueprint.create_blueprint",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "util.authorization.register_permission_enum",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "authorization.SeatingPermission",
"line_number": 31,
... |
626362340 | import numpy as np
import pylab
from multiprocessing import Pool, cpu_count
def RungeKutta(func, init, a, b, h=0.1):
X = []
T = np.arange(a, b, h)
x = init
for t in T:
X.append(x)
k1 = h * func(x, t)
k2 = h * func(x + k1 / 2, t + h / 2)
k3 = h * func(x + k2 / 2, t + h /... | null | Fall 2018/Comp/hw.5/p2.py | p2.py | py | 1,796 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "numpy.pi",
"line_number": ... |
528180607 | '''
For example, if the first wire's path is R8,U5,L5,D3, then starting from the central port (o), it goes right 8, up 5, left 5, and finally down 3:
[R8,U5,L5,D3]
...........
...........
...........
....+----+.
....|....|.
....|....|.
....|....|.
.........|.
.o-------+.
...........
[U7,R6,D4,L4]
...........
.+-----+... | null | d03p2.py | d03p2.py | py | 2,366 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number":... |
412282511 |
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from Web_iselenium.test.base_page import BasePage
class AddMemberPage(Bas... | null | test/add_member.py | add_member.py | py | 5,164 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Web_iselenium.test.base_page.BasePage",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.common.by.By.ID",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.by.By",
"line_number": 36,
"usage... |
383564759 | import torch.optim
from torch.utils.data import DataLoader
from dataset.flickrDataset import Flickr8kDataset
from utils import *
import torch.nn.functional as F
from tqdm import tqdm
from nlgeval import NLGEval
import pickle
import pandas as pd
import numpy as np
import time
# Parameters
caption_file = 'Flickr8k.arabi... | null | up_down_model/eval.py | eval.py | py | 8,231 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.optim.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.optim.cuda.is_available",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.op... |
421625845 | """MyAwesomeCart URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... | null | MyAwesomeCart/MyAwesomeCart/urls.py | urls.py | py | 1,657 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
423778160 | """
process for cancellation
if the button down is in the queue or l/r is in the queue, do not send again.
wait for a clearing signal, then send again.
opposite of mnD is mnU
opposite of mnL or mnR is mnC
if mnD is in SENT, do not send again until sending mnU
if mnL is in SENT, do not send again until sending mnC
if... | null | controllers.py | controllers.py | py | 3,465 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threading.Lock",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "queue.Queue",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_n... |
459547368 | import unittest
import apsw
from testutils import getZserioApi
class InstantiateTypeAsSqlTableFieldTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "templates.zs").instantiate_type_as_sql_table_field
def testReadWrite(self):
connection = apsw.Con... | null | test/language/templates/python/InstantiateTypeAsSqlTableFieldTest.py | InstantiateTypeAsSqlTableFieldTest.py | py | 849 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "testutils.getZserioApi",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "apsw.Connection",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "apsw.SQLI... |
50046369 | import sys
import json
import joblib
import datetime
import subprocess
import pandas as pd
from flask_pymongo import PyMongo, ObjectId
from flask_bootstrap import Bootstrap
from flask import Flask, render_template, url_for, request, redirect, jsonify
pd.set_option('max_columns', 1000)
pd.set_option('max_info_columns',... | null | command.py | command.py | py | 6,251 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.set_option",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.set_option",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.set_opti... |
281244648 | #! /usr/bin/env python
# coding: utf-8
import math
import cv2
import logging
import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import glob
from sklearn.cluster import MeanShift
logger = logging.getLogger(__name__)
def clustering(dens_... | null | src/model/clustering.py | clustering.py | py | 4,248 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_... |
557927723 | """
Copyright (c) 2020 The Orbit Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
"""
import logging
import time
from pywinauto.application import Application
from pywinauto.keyboard import send_keys
from core.orbit_e2e import E2ETestCase... | null | contrib/automation_tests/test_cases/connection_window.py | connection_window.py | py | 3,921 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pywinauto.application.Application",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "core.orbit_e2e.wait_for_condition",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "core.orbit_e2e.E2ETestCase",
"line_number": 20,
"usage_type": "name"
... |
517657988 | from flask import Flask, jsonify, request, make_response, Response, flash
from flask.ext.httpauth import HTTPBasicAuth
from flask_sqlalchemy import SQLAlchemy
from flask import render_template, redirect, url_for
import random, time
from socket import gethostname
from flask.ext.wtf import Form
from wtforms import String... | null | run.py | run.py | py | 10,321 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.ext.mail.Mail",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask.ext... |
306158165 | import os
import glob
config = dict()
config["image_shape"] = (128, 128, 128) # This determines what shape the images will be cropped/resampled to.
config["patch_shape"] = None # switch to None to train on the whole image
config["labels"] = (1, 2, 4) # the label numbers on the input image
config["n_base_filters"] =... | null | trails.py | trails.py | py | 4,875 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
607201274 | # coding: utf-8
import pandas as pd
import numpy as np
from sklearn.cluster import AgglomerativeClustering
import math
import gc
import heapq
from multiprocessing import Process
import multiprocessing
import datetime
from math import isnan
def to_list(x):
return list(x)
def to_array(x):
return np.array(list(... | null | feature/get_corr.py | get_corr.py | py | 6,644 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.AgglomerativeClustering",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "... |
508822593 | # Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | null | kaolin/graphics/SoftRenderer.py | SoftRenderer.py | py | 23,330 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "DifferentiableRenderer.DifferentiableRenderer",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 61,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"line_number": 75,
"usage_type": "attribute"
},
{
... |
125602905 | import pyglet
from pyglet.window import key
#constants
pc_chew_speed = 0.1
pc_pixel_step = 100
pc_move_direction = 0
window = pyglet.window.Window(width=672, height=744)
#Genral graphics
graphic_grid = pyglet.image.load('./resources/spritemap-384.png')
graphic_sequence = pyglet.image.ImageGrid(graphic_grid, 10, 16)... | null | __init__.py | __init__.py | py | 3,675 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyglet.window.Window",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pyglet.window",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pyglet.image.load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pyglet.imag... |
618977884 | import time
from typing import List, Dict, Tuple
from django.contrib.auth.models import User
from django.core.handlers.wsgi import WSGIRequest
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.http.response import JsonResponse
from django.shortcuts import render
from django.views.... | null | chess/backend/src/game/logic.py | logic.py | py | 11,936 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pychess.Utils.Board.Board",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "django.core.handlers.wsgi.WSGIRequest",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "game.game.GameState",
"line_number": 64,
"usage_type": "call"
},
{
... |
68999832 | # ReadableDicomDataset 객체 - DCM 파일 조작을 위한
import numpy as np
import pandas as pd
from pydicom import dataset
from sklearn.model_selection import train_test_split
import shutil
from pydicom.encaps import decode_data_sequence
from PIL import Image
from typing import Union
from glob import glob
import io
import pydicom... | null | utils/data_util_linux.py | data_util_linux.py | py | 14,415 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pydicom.dcmread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pydicom.encaps.decode_data_sequence",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "PIL.I... |
202526785 | # -*- coding: utf-8 -*-
import logging
_logger = logging.getLogger(__name__)
from openerp import api, models, fields
from openerp.exceptions import Warning
from datetime import datetime
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
@api.model
def create(self, values):
return_c... | null | account_banking_mandate_auto_create/models/res_partner_bank.py | res_partner_bank.py | py | 2,184 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "openerp.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "openerp.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "openerp.api.m... |
117953793 | from django.conf import settings
from django.conf.urls import *
from django.contrib import admin
from django.views.generic.base import TemplateView
from rest_framework import routers
import manabi.views
from manabi.apps.manabi_auth.api_views import RegistrationWithTokenView
from manabi.apps.flashcards.api_views import... | null | manabi/urls.py | urls.py | py | 3,502 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "rest_framework.routers",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "manabi.apps.flashcards.api_views.DeckViewSet",
"line_number": 25,
"usage_type... |
337955562 | import os
import numpy as np
from collections import Counter
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import BernoulliNB
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
print("START")
def make_Dictionary(root_dir,size):
all_words = []
emails = [os.path.join... | null | New folder/Ass1.py | Ass1.py | py | 3,076 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_... |
280329285 | from datetime import datetime
from typing import List, Optional
from fastapi import Depends, HTTPException, Path
from fastapi.param_functions import Query
from fastapi.responses import JSONResponse
from rx import operators as rxops
from api_server.base_app import BaseApp
from api_server.dependencies import pagination... | null | packages/api-server/api_server/routes/tasks/tasks.py | tasks.py | py | 5,255 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "api_server.fast_io.FastIORouter",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "api_server.base_app.BaseApp",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 34,
"usage_type": "name"
},
{
"api_n... |
271667268 | import copy
import datetime
import unittest
import cfdm
# Note: it is important we test on the cfdm logging config rather than the
# generic Python module logging (i.e. 'cfdm.logging' not just 'logging').
# Also, mimic the use in the codebase by using a module-specific logger:
log_name = __name__
logger = cfdm.loggi... | null | cfdm/test/test_decorators.py | test_decorators.py | py | 8,075 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cfdm.logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cfdm.logging",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "copy.deepcopy",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cfdm.decorator... |
99899365 | from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
import numpy as np
import torchvision
from torchvision import datasets, models, transforms
import matplotlib.pyplot as plt
import time
... | null | transfer_learning.py | transfer_learning.py | py | 2,245 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.ion",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 20,
"usage_type": "call"
},
{
"api_name":... |
515700353 | from typing import Dict
# This creates a json model to convert sql queries.
class Task():
def __init__(
self,
taskUserId,
taskId,
title,
taskDescription,
dateCreated,
completed,
):
self.taskUserId = taskUserId
self.taskId = taskId
... | null | functions/Model/Task.py | Task.py | py | 831 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.Dict",
"line_number": 26,
"usage_type": "name"
}
] |
215851569 | # MIT License
#
# Copyright (c) 2019 Oz N Tiram
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | null | examples/chick.py | chick.py | py | 24,466 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "re.DOTALL",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"... |
491013602 | from django.shortcuts import render, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from .forms import NumberForm
# Create your views here.
def index(request):
if request.method == 'GET':
form = NumberForm(request.GET)
if form.is_valid():
data = form.clean... | null | calculator/views.py | views.py | py | 633 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "forms.NumberForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "forms.NumberForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dja... |
374535707 | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int8
from std_msgs.msg import String
import serial
import binascii
import ema.libs.yei.threespace_api as ts_api
import time
def teste():
rospy.init_node('imu', anonymous=False)
pub = rospy.Publisher('imu/data', String, queue_size=10)
number_o... | null | scripts/imu_noapi_node.py | imu_noapi_node.py | py | 1,951 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rospy.init_node",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "rospy.Publisher",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "std_msgs.msg.String",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "serial.Serial... |
85868928 | import os
import sys
from PIL import Image
# 将输入路径的上两级路径加入系统
def set_projectpath(current_path):
curPath = os.path.abspath(current_path)
# curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
rootPath = os.path.split(rootPath)[0]
s... | null | utiles/utils.py | utils.py | py | 1,194 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
283701748 | from decimal import Decimal
from typing import Optional, List
from pydantic import BaseModel, condecimal, ValidationError
import stackprinter
#================================================================================
#================================================================================
class Order... | null | src/noobit/models/test.py | test.py | py | 2,680 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "decimal.Decimal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "decimal.Decimal",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "stackprinter.format",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pydantic.dict",
... |
145207432 | # 导入类
from __future__ import print_function
from argparse import ArgumentParser
import torch
from torch.utils.data import DataLoader
from torch import nn
import torch.nn.functional as F
from torch.optim import SGD
from torchvision.datasets import MNIST
from torchvision.transforms import Compose, ToTensor, Normalize
... | null | templete/MNIST_tensorboardX.py | MNIST_tensorboardX.py | py | 6,147 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
541164479 | from l3addr import L3Addr
from utils import maskToHostMask, maskToInt
#from icecream import ic
class L3Interface:
def __init__(self, number: int, addr: str, mask_numbits: int):
self._number = number
self._mask = maskToInt(mask_numbits)
#print(self._mask)
self._mask_numbits = mask_... | null | routing/l3interface.py | l3interface.py | py | 2,388 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.maskToInt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "l3addr.L3Addr",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.maskToHostMask",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "l3addr.L3Addr",
... |
520232988 | """
(prototype) Graph Mode Post Training Static Quantization in PyTorch
=========================================================
**Author**: `Jerry Zhang <https://github.com/jerryzh168>`_
This tutorial introduces the steps to do post training static quantization in graph mode.
The advantage of graph mode quantizati... | null | prototype_source/graph_mode_static_quantization_tutorial.py | graph_mode_static_quantization_tutorial.py | py | 20,021 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "torch.manual_seed",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "tor... |
417353158 | import pytest
from vyper.context.types import get_primitive_types
from vyper.context.types.indexable.sequence import ArrayDefinition
from vyper.context.types.utils import get_type_from_abi
from vyper.exceptions import UnknownType
BASE_TYPES = ["int128", "uint256", "bool", "address", "bytes32"]
@pytest.mark.parametr... | null | tests/functional/context/types/test_type_from_abi.py | test_type_from_abi.py | py | 1,641 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "vyper.context.types.get_primitive_types",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "vyper.context.types.utils.get_type_from_abi",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 11,
"usage_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.