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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
640213051 | import random
# Deck — колода, Suit — масть
# Hearts — червы, Diamonds — бубны
# Clubs — трефы, Spades — пики
# Jack — валет, Queen — дама, King — король, Ace — туз, Joker — джокер
suits = ['Hearts', 'Diamonds', 'Clubs', 'Spades']
numb = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King', 'Ace']
# suit = random.ch... | null | m2.py | m2.py | py | 970 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.choices",
"line_number": 36,
"usage_type": "call"
}
] |
581100993 | # -*- coding: utf-8 -*-
import pyhermes
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from threadlocals.threadlocals import get_current_user
from ralph.data_center.models.physical import DataCenterAsset
from ralph.data_center.models.virtual import ... | null | src/ralph/dns/publishers.py | publishers.py | py | 1,550 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "threadlocals.threadlocals.get_current_user",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.DNSAAS_OWNER",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 19,
"usage_type":... |
529663354 | import json
import math
class KnnAlgorithm(object):
def __init__(self, data, k):
self.data = json.loads(data.read())
self.k = k
self.models = []
self.distances = []
self.labeled = []
self.neighbours = []
self.prediction = ''
def trainData(self):
for key in range(len(self.data)):
... | null | index.py | index.py | py | 2,121 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 32,
"usage_type": "call"
}
] |
190603135 | import sys
sys.path.append('../../')
import numpy as np
import Lock
import time
import os
from os.path import join
from datetime import datetime
from util import utilities as Utils
from sklearn.metrics import confusion_matrix
from core4.AspectLearnerGSOM import AspectLearnerGSOM
from core4.AssociativeGSOM import Asso... | null | Main.py | Main.py | py | 8,554 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.... |
366428989 | # Copyright 2018 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | null | projectq/setups/grid_test.py | grid_test.py | py | 3,166 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "projectq.setups.grid.get_engine_list",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "projectq.setups.grid",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "projectq.cengines.GridMapper",
"line_number": 29,
"usage_type": "argument"
},... |
94124984 | from __future__ import division, print_function
import numpy as np
import os
import pandas as pd
import xarray as xr
def _get_Berger_data():
'''Read in the Berger and Loutre orbital table as a pandas dataframe, convert to xarray
'''
orbit91_file = 'orbit91'
orbit91_url = "https://www1.ncdc.noaa.gov/pu... | null | climlab/solar/orbital/table.py | table.py | py | 1,733 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
340524596 | import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
import galsim
import pandas as pd
from lmfit import Minimizer, Parameters
import pickle
import helperFunctions as helper
# basedir = '/Users/clairealice/Documents/Research/Burchat/SpeckleAnalysis/'
# gains = {'025': {'a': 14.9, 'b': 12.8},... | null | Code/SpecklePSF.py | SpecklePSF.py | py | 16,387 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "numpy.logspace",
"line_numbe... |
633723637 | #! /usr/bin/env python3
import numpy as np
import argparse
import os
parser = argparse.ArgumentParser(description="Takes a grid of parameter samples and splits it based on which angular bin a given sample falls inside of")
parser.add_argument("--grid-file", help="Name of the full grid file")
parser.add_argument("--ou... | null | bin/partition_grid.py | partition_grid.py | py | 1,398 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
... |
289845436 | # coding=utf8
from collections import deque
# 递归深度优先
# 深度优先是一次访问到底,知道没有连接的顶点,再逐级返回,再逐级访问
def dfs(G, v, visited=set()):
print(v)
visited.add(v) # 用来存放已经访问过的顶点
# G[v] 是这个顶点的相邻的顶点
for u in G[v]:
# 这一步很重要,否则就进入了无限循环,只有这个顶点没有出现在这个集合中才会访问
if u not in visited:
dfs(G, u, visited... | null | 数据结构与算法/图搜索/BFS-DFS-2.py | BFS-DFS-2.py | py | 1,545 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 38,
"usage_type": "call"
}
] |
241820415 | import numpy as np
import os
import csv
import matplotlib.pyplot as plt
sysname = 'invpen'
task = 'ilqr'
cmd = (' ').join(['./run',sysname,task])
os.system(cmd)
filename = 'invpen/invpen_ilqr_result.csv'
with open(filename) as file:
filereader = csv.reader(file,delimiter=',')
ii = 0
for row in filereader:... | null | ilqrinvpen.py | ilqrinvpen.py | py | 696 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.system",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_... |
309238274 | from django.conf import settings
from django.conf.urls import url
from fwssearch.views import HomeView, get_extra_cont
from fwssearch.models import get_queries
from . import views
lang_query, env_query, par_query, new_query, pop_query, fav_query = get_queries()
patterns = []
for lang in lang_query:
if lang.name ... | null | fwssearch/urls.py | urls.py | py | 1,875 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "fwssearch.models.get_queries",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fwssearch.views.HomeView.as_view",
"line_number": 13,
"usage_type": "call"
},
{
... |
266293064 |
import json
import argparse
import sys
from tabulate import tabulate
def parse_mapper_output(line):
clus, values = line.strip().split("\t", 1)
clus = int(clus)
# values are: (1, <vector, 1000d>, label, userid)
values = json.loads(values)
_, __, label, ___ = values
return clus, label
def cross... | null | week4-hw/cross_tab.py | cross_tab.py | py | 1,062 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "tabulate.tabulate",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",... |
222364957 | """ Retrieve Neurio sensor data directly from your sensor
Outputs in either json or key=value format with a timestamp of when the data
was fetched.
"""
__author__ = "Ed Hunsinger"
__email__ = "edrabbit@edrabbit.com"
import argparse
import datetime
import json
import logging
import bs4
import pytz
import urllib2
... | null | fetch_neurio.py | fetch_neurio.py | py | 5,224 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "urllib2.urlopen",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "datetime... |
654279752 | from qiskit import QuantumCircuit
qasm = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[1];
qreg r[1];
creg c[1];
cz q, r;
barrier q, r;
x q;
y q;
measure q -> c;
z q;
if (c==1) z r;
"""
circ = QuantumCircuit.from_qasm_str(qasm)
circ.draw(output='mpl')
| null | Terra_2/Test_30/Test_30.py | Test_30.py | py | 253 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "qiskit.QuantumCircuit.from_qasm_str",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "qiskit.QuantumCircuit",
"line_number": 16,
"usage_type": "name"
}
] |
370554310 | import sys
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtGui import QPalette
from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget
from PyQt5.QtCore import QSize
from PyQt5.QtCore import QTimer
import time
class HelloWindow ( QMainWindow ) :
def handleTimer(self) :
lTime = time.... | null | Main.py | Main.py | py | 2,279 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "time.localtime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.asctime",
... |
251149264 | from django.conf.urls import url
from views import *
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^$', login_required(dashboard), name=u'Library_dashboard'),
url(r'^bookrent/$', login_required(bookrent), name=u'Library_bookrent'),
... | null | Library/urls.py | urls.py | py | 980 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.decorators.login_required",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
... |
285963647 | import xml.etree.ElementTree as ET
from broadsoft.requestobjects.lib.BroadsoftRequest import BroadsoftRequest
from nettools.MACtools import MAC
"""
This is for creating Device/Identity Profiles...we actually don't want to do that; we are planning on using a single
master generic profile for all our phones. Don't expec... | null | broadsoft/requestobjects/GroupAccessDeviceAddRequest.py | GroupAccessDeviceAddRequest.py | py | 3,150 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "broadsoft.requestobjects.lib.BroadsoftRequest.BroadsoftRequest",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "broadsoft.requestobjects.lib.BroadsoftRequest.BroadsoftRequest.__init__",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "broadsoft.... |
331559426 | from enum import Enum
import random
from .base import MaskFn
class MaskTokenNumberType(Enum):
ONE = 0
TWO = 1
THREE = 2
FOUR = 3
FIVE = 4
SIX = 5
SEVEN_OR_MORE = 6
class MaskTokenNumber(MaskFn):
def __init__(self, p=0.15):
self.p = p
@classmethod
def mask_types(cls):
return list(Mask... | null | ilm/mask/custom.py | custom.py | py | 4,217 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "base.MaskFn",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "random.random",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number":... |
46439080 | __all__ = [
"HKEntry"
, "HotKeyBinding"
, "HotKey"
, "KeyboardSettings"
]
# ML should be used there (instead of mlget) because the key will be modified
from common import (
Persistent,
mlget as _
)
from six.moves.tkinter import (
END,
Entry
)
from os.path import (
dirname,
join
)
from... | null | widgets/hotkey.py | hotkey.py | py | 5,851 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "six.moves.tkinter.Entry",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "six.moves.tkinter.Entry.__init__",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "six.moves.tkinter.Entry",
"line_number": 28,
"usage_type": "name"
},
{
"... |
220754736 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 3 09:51:56 2017
@author: py
"""
__author__ = 'py'
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
from Layer import Layer
from configs import configs
config = configs()
def generate_data():
'''
gen... | null | hw1/mlp.py | mlp.py | py | 7,558 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "configs.configs",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "sklearn.datasets.... |
86433636 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import parameters
import pandas as pd
import seaborn as sns
from IPython.display import Image
import itertools
marker = itertools.cycle((',', '+', '.', 'o', '*'))
#########################################################
############... | null | Nickel.py | Nickel.py | py | 5,532 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.cycle",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "numpy.arg... |
229417985 | import nested_admin
from django.contrib import admin
from django.contrib import messages
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.utils import translation
from django.shortcuts import reverse, redirect
from django.core.exceptions import ImproperlyConfigured
from rangef... | null | simpellab/modules/sales/admin.py | admin.py | py | 6,959 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "django.utils.translation",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "nested_admin.NestedTabularInline",
"line_number": 21,
"usage_type": ... |
19286407 | import json
import requests
from flask import request
from flask.exceptions import JSONBadRequest
from apio.tools import get_arg_spec, serialize_action_arguments, apply_to_action_func, JSONPayload
from apio.exceptions import APIError, SpecError
class Action(object):
def __init__(self, func):
self.name =... | null | apio/actions.py | actions.py | py | 3,548 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "apio.tools.get_arg_spec",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "apio.tools.serialize_action_arguments",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "apio.tools.apply_to_action_func",
"line_number": 29,
"usage_type": "call"
... |
159075713 | # coding=utf-8
import re
import time
import asyncio
import threading
import pytest
from aiohttp import web
from motse.http import HttpRequest, HttpResponse
from motse.downloadermws import *
from motse.errors import IgnoreRequest, ResponseNotMatch
from .helpers import wait_server_start
@pytest.fixture(scope="modul... | null | tests/test_downloadermws.py | test_downloadermws.py | py | 5,887 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "asyncio.new_event_loop",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "asyncio.set_event_loop",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "motse.ht... |
237500319 | import eventlet
import flask
from cards import *
from flask import request, jsonify, render_template, redirect, url_for, session, g
from os import urandom
import os
import random, string
from flask_socketio import SocketIO, join_room, leave_room, send, emit, rooms
import json
import redis
app = flask.Flask(__name__)
... | null | main.py | main.py | py | 15,639 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.urandom",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "redis.from_url",
"... |
269248983 | from socketserver import BaseRequestHandler,TCPServer
import json
import struct,os
def fetchstr(a):
totl=0
tots=b""
while True:
x=a.recv(4-totl)
if not x:
return ""
tots+=x
totl+=len(x)
if totl==4:
break
sz=struct.unpack("<I",tots)[0]
t... | null | srv.py | srv.py | py | 1,295 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "struct.unpack",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 3... |
635106667 | from apscheduler.executors.asyncio import AsyncIOExecutor
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from pytz import utc
from loop import event_loop
from settings import DATABASE_CONNECTION_URL
jobstores = {
'default': SQLAlchemyJob... | null | background/scheduler.py | scheduler.py | py | 634 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "apscheduler.jobstores.sqlalchemy.SQLAlchemyJobStore",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "settings.DATABASE_CONNECTION_URL",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "apscheduler.executors.asyncio.AsyncIOExecutor",
"line_nu... |
573594905 | import sys
from scipy.interpolate import UnivariateSpline
import numpy as np
n = int(sys.stdin.readline())
raw_prices = []
for i in range(0, n):
line = sys.stdin.readline()
timestamp, price = line.split("\t")
raw_prices.append(price)
prices_ind = []
missing_prices_ind = []
prices = []
for i in range(0,... | null | missing-stock-prices/missing-stock-prices.py | missing-stock-prices.py | py | 623 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.stdin.readline",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"l... |
117265454 | import torch
from torch.autograd import Variable
class agent:
def __init__(self, net):
self.net = net
self.optimizer = torch.optim.Adam(self.net.parameters(), lr=1e-3)
self.loss_func = torch.nn.CrossEntropyLoss()
self.train_loss = 0
self.train_acc = 0
def optimize(self... | null | DigitClassification/agent.py | agent.py | py | 1,046 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.optim.Adam",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.CrossEntropyLoss",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.nn",
... |
145155403 | import requests
from bs4 import BeautifulSoup
URL = 'https://internshala.com/internships-for-women/matching-preferences'
page = requests.get(URL)
soup = BeautifulSoup(page.content,'html.parser')
results = soup.find(id='list_container')
interships = results.find_all('div', {"id" : "internship-list-container"})
print(i... | null | scrap.py | scrap.py | py | 514 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 7,
"usage_type": "call"
}
] |
103390018 | from enum import Enum
class LIDType(Enum):
# BC for bio-retention cell; PP for porous pavement; IT for infiltration trench; RB for rain barrel;
# VS for vegetative swale.
BC = 1
PP = 2
IT = 3
RB = 4
VS = 5
class LIDControl:
"""Defines scale-independent LID controls that can be de... | null | src/core/swmm/hydrology/lidcontrol.py | lidcontrol.py | py | 4,574 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 4,
"usage_type": "name"
}
] |
615444392 | from odoo import models, fields, api, _
from num2words import num2words
import logging
_logger = logging.getLogger(__name__)
class AccountRegisterPayments(models.TransientModel):
_inherit = "account.register.payments"
@api.onchange('amount')
def _onchange_amount(self):
if hasattr(super(AccountRegisterPayments, ... | null | models/account_payment.py | account_payment.py | py | 2,237 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "odoo.models.TransientModel",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "num2words.... |
427717313 | import collections
from rest_framework.views import exception_handler
def custom_exception_handler(exc, context):
# Call REST framework's celery exception handler first,
# to get the standard error response.
response = exception_handler(exc, context)
if response is not None:
data = response.... | null | utils/handlers/exceptions.py | exceptions.py | py | 922 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.views.exception_handler",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.MutableMapping",
"line_number": 31,
"usage_type": "attribute"
}
] |
441142173 | from lxml import etree
# 构造一个XPath可解析的对象
html = etree.parse('test.html',parser=etree.HTMLParser())
# 调用xpath(路径选择表达式)的方法,选中href属性为link4.html的a节点,
# 然后再获取其父节点,然后再获取其class属性
res = html.xpath('//a[@href="link4.html"]/parent::*/@class')
print(res)
| null | Xpath/xpath_09.py | xpath_09.py | py | 345 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "lxml.etree.parse",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "lxml.etree.HTMLParser",
"line_number": 4,
"usage_type": "call"
}
] |
322599226 | from django.shortcuts import render
from django.http import JsonResponse
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from .models import Greeting
from .models import Message as MessageModel
from django.contrib.auth.models import User
from .ser... | null | hello/views.py | views.py | py | 2,422 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.models.User.objects.get",
"line_number": 19,
"usage_type": "call... |
333324459 | """
Source :
http://yann.lecun.com/exdb/mnist/
"""
import os,struct,numpy as np
import matplotlib.pyplot as plt
from tables.table import _index_name_of_
def load_mnist(path,kind='train'):
"""
Load MNIST data from path
:param path:
:param kind:
:return:
"""
labels_path = os.path.join(path,... | null | Machine_Learning/12 - Training Artificial Neural Network for Image Recognition/Classify Hand Written Digits.py | Classify Hand Written Digits.py | py | 1,740 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
628430566 | #coding:utf-8
"""
\u6570\u636E\u5E93\u8FDE\u63A5\u7BA1\u7406
"""
__author__ = "liangxiaokai@21cn.com"
__version__ = "1.0"
__date__ = "2011/04/14"
__copyright__ = "Copyright (c) 2011"
__license__ = "Python"
from .connect import *
from sqlalchemy import Table,Column,func
from sqlalchemy.types import *
from sqlalchem... | null | xgame/db/niuniu.py | niuniu.py | py | 873 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.Table",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Colum... |
104681579 | # -*- coding: utf-8 -*-
from django.views.generic.edit import FormView
from formtools.wizard.views import SessionWizardView
from .forms import *
from django.shortcuts import redirect
class MyWizardView(SessionWizardView):
form_list = [Form1, Form2]
template_name = 'foobar/wizard.html'
def done(self, ... | null | foobar/views.py | views.py | py | 668 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "formtools.wizard.views.SessionWizardView",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.FormView",
"line_number": 17,
"usage_type": "name"
}
] |
137016127 | from typing import List, Literal
from ...utils.type_mappers import (
postgresql_to_pyarrow,
postgresql_to_python,
spectrum_to_postgresql,
)
from .base import RDBMSWriteBase
class Redshift(RDBMSWriteBase):
"""
Class that represents Redshift database.
https://aws.amazon.com/redshift/
Exam... | null | grizly/sources/rdbms/redshift.py | redshift.py | py | 6,354 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "base.RDBMSWriteBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 63,
"usage_type": "name"
},
{
"api_name": "typing.List",
"lin... |
592139031 | _author__ = 'tkraus-m'
import yaml
import argparse
# Initiate the parser
parser = argparse.ArgumentParser()
# add long and short argument
parser.add_argument('--file', '-f')
parser.add_argument('--server', '-s')
parser.add_argument('--repo', '-r')
parser.add_argument('--tag', '-t')
# read arguments from the command l... | null | scripts/yaml-sub.py | yaml-sub.py | py | 1,329 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
... |
248672457 | #!env python
""" USAGE:
jupyter console -i --pdb -c "$(
cat <<-'EOF'
import sys,os
sys.path.append(os.environ["BD"] + "/html/console_browser")
from browser_base import *
kwargs = {
"chromedriver_input_defaults":{
"incognito":False
,"disable-plugins":False
}
,"console_... | null | html/console_browser/browser_base.py | browser_base.py | py | 81,446 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 126,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
41521050 | #!/usr/bin/env python3
from plumbum import cli
from plumbum.cmd import mkdir
from pprof.driver import PollyProfiling
from pprof.settings import config
from pprof.utils.user_interface import query_yes_no
from pprof.experiments import *
import os, os.path
@PollyProfiling.subcommand("run")
class PprofRun(cli.Applicatio... | null | pprof/run.py | run.py | py | 5,930 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "plumbum.cli.Application",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "plumbum.cli",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "pprof.settings.config",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "plumbu... |
413100765 | from interfaces import Credentials, Session, VehicleConfig, SeatClimate
from math import e
import logging
import requests
logging.basicConfig(level=logging.INFO)
class BlueLink():
"""
Blue Link wrapper class.
Communicates with BlueLink endpoints and sends HTTP requests.
:param credentials: Containin... | null | bluelink.py | bluelink.py | py | 9,549 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "interfaces.Session.ACCESS_TOKEN",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name... |
368043895 | # Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | null | hl7_bridges/hl7_bridge.py | hl7_bridge.py | py | 9,675 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rclpy.node.Node",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "asyncio.new_event_loop",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "asyncio.set_event_loop",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "janus.Q... |
83659133 | from apiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
import pickle
import json
credentials = pickle.load(file=open("token.pkl", "rb"))
service = build("calendar", "v3", credentials=credentials)
calendar_items = service.calendarList().list().execute()
calendars = []
for item ... | null | check_calendar.py | check_calendar.py | py | 713 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "apiclient.discovery.build",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 24,
"usage_type": "call"
}
] |
351846129 | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
from pylab import rcParams
from pylab import savefig
address = '~/Desktop/code/hrdata.csv'
hr = pd.read_csv(address)
print(hr.head(10))
print(hr.describe())
age = hr['Age']
gender = hr['Sex']
pay = hr['Pay Rate']
source = hr['Employee Source']
... | null | hr_coding.py | hr_coding.py | py | 1,039 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pylab.rcParams",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "seaborn.set_style",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.xla... |
629702740 | import pickle
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
import utils
class Model(nn.Module):
def __init__(self, size=4, alpha=1, n=100, d=2, sigma=1, half_empty=True):
super().__init__()
self.alpha = alpha
self.d = d
self.sigma = s... | null | non_negativity/nonnegative_fixed.py | nonnegative_fixed.py | py | 2,973 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
371194382 | from behave import given, when, then, Then
from click.testing import CliRunner
from sure import expect
from doodledashboard.cli import view, start, list
@given("I have the configuration called '{config_filename}'")
def _given_i_have_the_configuration_x(context, config_filename):
if "dashboard_local_configs" not ... | null | features/steps/cli.py | cli.py | py | 2,367 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "behave.given",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "behave.given",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "behave.Then",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "click.testing.CliRunner",
"l... |
139270408 |
import os
import random
from ...utils import pick_phrase
regex = {
"add_skill": [
"(?:new|add) skill as(?: a)? <type> name(?: it)? <<name>>",
"(?:new|add) skill name(?: it)? <<name>>",
"(?:new|add) skill as(?: a)? <type>",
"(?:new|add) skill"
]
}
ask_name = [
"How would y... | null | assistant/skills/add_skill/add_skill.py | add_skill.py | py | 3,162 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "random.choice",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "utils.pick_phrase",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "os.mkdir",
"line_nu... |
501631026 | """Module with mongo query builders."""
import json
import pystache
from os import path
from app.infrastructure.configuration import get_config
LIST_CALLS = "list-calls.query"
FIND_PHONE_BILL = "find-phone-bill.query"
_QUERIES = {}
def build(query_name, **kwargs):
"""Build query for searching call records at b... | null | app/repository/query.py | query.py | py | 613 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "app.infrastructure.configuration.get_config",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "json... |
353317096 | #!/usr/bin/env python3
PKG_NAME = "Contacts"
import os, sys
filepath = os.path.abspath(__file__)
fullpath = os.path.dirname(filepath) + '/'
from gi.repository import Gtk, Gdk, Pango, GdkPixbuf
from base64 import b64decode
from PIL import Image
import io, array
from vcard import Vcf
# exec(open(fullpath + "mysettin... | null | main.py | main.py | py | 9,053 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
128912038 | # our work to try and grab statcast data. we completed it elsewhere
# but it's worthwhile to keep our attempt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from flask import Flask, render_template, redirect, jsonify
from flask_pymongo import PyMongo
import json
from bson.objectid import ObjectId... | null | statcast _tries.py | statcast _tries.py | py | 6,351 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.render_templa... |
247612740 | import numpy as np
import os
import SimpleITK as sitk
import matplotlib.pyplot as plt
import glob
import re
from numpy import unravel_index
from scipy.optimize import curve_fit
from scipy.misc import factorial #for poisson distr
class AutoFocus:
def __init__(self):
self.parentDir = None
sel... | null | focusDetection.py | focusDetection.py | py | 13,313 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.empty",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": ... |
235919248 | # 18.09.2017
import csv
from datetime import datetime
from matplotlib import pyplot as plt
# Get dates and precipitations from file.
filename = 'san_francisco_2014.csv'
with open(filename) as f:
reader = csv.reader(f)
header_row = next(reader)
dates, precipitations = [], []
for row in reader:
... | null | Projects/Data Visualization/Exercises/exercise_16_3/rainfall.py | rainfall.py | py | 1,026 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.reader",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
124635515 | import os
import pandas as pd
import config as cfg
directory = os.path.join(cfg.MEDEA_ROOT_DIR, 'data', 'raw', 'AggregatedGenerationPerType')
df_ror = pd.DataFrame()
for file in os.listdir(directory):
filename = os.fsdecode(file)
print(filename)
if filename.endswith('.csv'):
df_tmpfile = pd.Data... | null | src/data/compile_HydroGeneration.py | compile_HydroGeneration.py | py | 2,463 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "config.MEDEA_ROOT_DIR",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
... |
344759494 | from flask import Flask, request, url_for, render_template, jsonify
from twilio.jwt.access_token.grants import ConversationsGrant, VideoGrant
from db_access import *
from twilio.rest import Client
import twilio
import json
app = Flask(__name__)
@app.route('/')
def index():
return render_template('video.html')... | null | FlaskServer/app.py | app.py | py | 1,363 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "flask.req... |
57308734 | import datetime
from dateutil import tz
import re
import Util
import json
import logging
import pysftp
import sys
logging.basicConfig(format='%(message)s')
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
# log.setLevel(logging.DEBUG)
# This is a sample Python script.
# Press Shift+F10 to execute it or r... | null | main.py | main.py | py | 8,601 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.basicConfig",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "Util.authenti... |
221824257 | import os
import requests
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
try:
r = requests.get("http://%s" % os.environ['BACKEND'])
if r.status_code == 200:
return "frontend:v1 - %s\n" % r.text
else:
return "frontend:v1 failed to contact %... | null | images/frontend/v1/app/main.py | main.py | py | 544 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.get",
"line_number": 13,... |
113733134 | import gurobipy as gp
from gurobipy import GRB
from gurobipy import *
import pandas as pd
import numpy as np
########################################
########### IMPORT DATA ################
########################################
#list of teams that are included in the analysis
Team_list={
0:"Atlanta Falcons",1:"Ca... | null | NFL Workshop/code/nfl 1.py | nfl 1.py | py | 4,011 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "gurobipy.Model",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "gurobipy.GRB.BINARY",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "gurobipy.GRB"... |
444695617 | from __future__ import print_function
import os
import re
import sys
import ujson
import flask
import random
import shutil
import flask_classful
import flaskext.markdown as flask_markdown
from Game import GameRunner
from Game import GameLanguage
from Database import GameDB
def static_file(filename):
resource_path... | null | CYLGame/Server.py | Server.py | py | 9,000 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "socket.gethostbyname_ex",
... |
543462376 | from datetime import datetime
from ..mongo import Document
from ..users import User
class Article(Document):
collection = 'articles'
fields = {
'author': User,
'content_html': str,
'content_md': str,
'created_at': datetime,
'title': str,
'slug': str,
'... | null | revfiyawo/blog/models.py | models.py | py | 578 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "mongo.Document",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "users.User",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",... |
431435221 | # ==================================================
# library
# ==================================================
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import messagebox
from tkinter import filedialog
import sqlite3
import pandas as pd
import datetime
import os
import csv
import sys
import m... | null | tenki/f02.py | f02.py | py | 45,396 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "bs4.scraping",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line... |
333415222 | import uuid
from django.db import models
class Article(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4)
author_id = models.ForeignKey("author.Author", on_delete=models.CASCADE)
category = models.CharField(max_length=255)
title = models.CharField(max_length=255)
summary = ... | null | app/article/models.py | models.py | py | 459 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.UUIDField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
278716214 | ## Still some issue, not working well
import numpy as np
import cv2
from matplotlib import pyplot as plt
# step 1 - load the model
net = cv2.dnn.readNet('yolo_data/yolov5s.onnx')
# step 2 - feed a 640x640 image to get predictions
def format_yolov5(frame):
row, col, _ = frame.shape
_max = max(col, row)
... | null | playground/hello-openCV/detect_anything_yolo_v5.py | detect_anything_yolo_v5.py | py | 2,540 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.dnn.readNet",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_numb... |
122422776 | from django.urls import path
from . import views
urlpatterns = [
path('', views.Home, name='home'),
path('fashion', views.Fashion, name='fashion'),
path('model', views.Model, name='model'),
path('travel', views.Travel, name='travel'),
path('about', views.About, name='about'),
path('contac... | null | DjangoProjects/social_projects/blog_project/apps/blog/urls.py | urls.py | py | 940 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
74156938 |
import pandas as pd
import re
from functools import reduce
from collections import Counter
import pald_funcs as pldfunc
def intersect_series_values(df, func):
'''Returns the intersection of lists in a Series input. In the Series
input, each row is a list. The function returns the intersection over
all li... | null | .ipynb_checkpoints/UR_host_funcs-checkpoint.py | UR_host_funcs-checkpoint.py | py | 2,887 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functools.reduce",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.search",
... |
640648453 | import cv2
import numpy as np
import os
index = 2600
while True:
# Input image
img_b = cv2.imread("frame_normalize_blue_0/frame%d.jpg" %index, -1)
img_rgb = cv2.imread("blue_hsv/%d.jpg" %index)
img_tem = cv2.imread("frame_denoise/frame%d.jpg" %index)
images = [img_b]
mask = np.zeros(img_b.... | null | TrafficSignDetection/PreprocessCode/mser_blue.py | mser_blue.py | py | 1,195 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 13,
... |
493918358 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup1 import Country, Destination, Base, User
engine = create_engine('sqlite:///traveldestinationswithusers.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
#create dummy ... | null | lotsofcountries.py | lotsofcountries.py | py | 2,421 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "database_setup1.Base.metadata",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "database_setup1.Base",
"line_number": 6,
"usage_type": "name"
},
{
"api... |
570703939 | #!/usr/bin/env python
import numpy as np, os, sys
import matplotlib as mpl, matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.inset_locator import inset_axes
import sim
from setup import *
mpl.rcParams.update(params)
N = 101
def calcPotential(x, FF_file, ptype, Cut = 10.0):
# make a dummy system with 1 poten... | null | review/plot_potentials_cutoff.py | plot_potentials_cutoff.py | py | 2,947 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.rcParams.update",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sim.chem.AtomType",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "s... |
358978415 | #####################################################################
# The code in this file provides the user the functionality #
# to write to TFRecord format and read/prepare dataset #
# from TFRecord. Must use the Estimator API #
#######################################... | null | lib/tfrecord_tools.py | tfrecord_tools.py | py | 6,430 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.image.imread",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tensorflow.train.Feature",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tensor... |
355372886 | import matplotlib.pyplot as plt
from os import listdir, environ
from sys import argv, exit
import plotext.plot as plx
from termcolor import colored
import numpy as np
import pandas as pd
def input_file():
"""
DESCRIPTION
Function for setting the file_name. It can be the default (PES.plt) or an input fi... | null | PESplotter.py | PESplotter.py | py | 4,633 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "os.listdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 22... |
539697687 | from os import path
from django.test import TestCase
from people.factories.organization_factory import OrganizationFactory
from people.factories.person_factory import PersonFactory
from people.factories.project_factory import ProjectFactory
from people.models import Organization
class TestOrganization(TestCase):
... | null | rppl/people/tests/test_models.py | test_models.py | py | 1,870 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "people.models.Organization.objects.count",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "people.models.Organization.objects",
"line_number": 15,
"usage_type": "attr... |
114881243 | #!/usr/bin/env python
# coding: utf-8
# Se importan librerías:
import os # Listado archivos
import cv2 # OpenCV
import numpy as np # Manipular arrays
import time # Medir el tiempo de ejecución
# Se carga el documento de clases de Imagenet:
filas = open('/home/pi/T-F-M/resnet50/modelos/labels.txt').read().strip().split... | null | RPi/ResNet50/inferencia_cpu.py | inferencia_cpu.py | py | 3,769 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.dnn.readNetFromCaffe",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "cv2.dnn",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cv2.dnn",
"lin... |
178826430 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 15 01:46:02 2019
@author: Okale
"""
import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
def leer_imagenes(filas,columnas,num_imagenes,ruta):
image_box = np.zeros((filas,columnas,num_imagenes),dtype="float64")
indice = 0
i = 0
... | null | segmentacion_autos_ordinario.py | segmentacion_autos_ordinario.py | py | 1,792 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.IMREAD_GRAYSCALE",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"l... |
43020686 | import base64
import json
import os
from django.conf import settings
from waiting import wait, TimeoutExpired
from sandbox.apps.devices.core.emulators import emulators_controller
from sandbox.libs.logs.core.ws import ws_log_message
from sandbox.apps.provision.core.common import provision_generated_predicate
from sand... | null | iot-sandbox/sandbox/sandbox/apps/devices/core/provision.py | provision.py | py | 4,728 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.SANDBOX_TEMP_DIR",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "... |
445482620 | from django.views.generic.base import TemplateView
import json
from django.http.response import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from .models import *
from digitalizacion.models import *
from cartera.models import *
from verificaciones.models import... | null | metropolitana/views.py | views.py | py | 7,026 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.views.generic.base.TemplateView",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "django.views.generic.base.TemplateView",
"line_number": 26,
"usag... |
507698227 | # Copyright 2019 GreenWaves Technologies, SAS
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to i... | null | tools/nntool/execution/execute_graph.py | execute_graph.py | py | 18,065 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "graph.types.InputParameters",
"line_number": 31,
"usage_type": "argument"
},
{
"api_name": "typing.Mapping",
"line_number": 88,
"usage_type": "name"
},
{
"api_name": "util... |
186372370 | ### python-vasp module
import os
import json
import re
import sys
import argparse
from common import whereami
"""
repository for many vasp script
get_vasp_repository()
get_atoms_4pos()
make_mag_4pos()
def make_incar(dic, iofile):
def make_kpoints(kp, MH|gamma, **args=[band])
"""
### VASP i... | null | pyvasp/mod_vas.py | mod_vas.py | py | 17,234 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.popen",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 67,
"us... |
649888988 | # Note: In given example, we not added environment reference anywhere.
# Project create command will pick one Environment module from file and attaches to project
import uuid
import json
from calm.dsl.builtins import Project, read_local_file, readiness_probe
from calm.dsl.builtins import Provider, Ref
from calm.dsl.b... | null | tests/project/test_project_with_env.py | test_project_with_env.py | py | 4,350 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "calm.dsl.builtins.read_local_file",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "calm.dsl.builtins.read_local_file",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "calm.dsl.builtins.basic_cred",
"line_number": 17,
"usage_type": "call... |
154385224 | from website.frontend import template_folder
from flask import (
Blueprint,
render_template,
abort
)
import os
docs_bp = Blueprint('docs', __name__)
@docs_bp.route('/')
def show_basics():
return render_template('docs/basics.html')
@docs_bp.route('/<string:page>/')
def show_pages(page):
if os.p... | null | website/frontend/views/docs.py | docs.py | py | 473 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"l... |
567577793 | from django.core.management.base import BaseCommand
import numpy as np
from spiders.models import PAGE
class Command(BaseCommand):
def handle(self, *args, **options):
pages=PAGE.objects.all()
num=len(pages)
G_matrix=np.zeros((num, num))
alpha=0.85
row=0
fo... | null | spiders/management/commands/pagerank.py | pagerank.py | py | 1,348 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "spiders.models.PAGE.objects.all",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "spiders.models.PAGE.objects",
"line_number": 9,
"usage_type": "attr... |
606466094 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Base class for all models (pytorch)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from os.path import join, isfile, basename
from glob import glob
import numpy as np
import logging
logger =... | null | models/pytorch_v3/base.py | base.py | py | 14,793 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.optim.SGD",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "torch.optim",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.optim.SGD",
... |
506972177 | # -*- coding: UTF-8 -*-
import connexion
from datetime import date
from typing import List, Dict
from six import iteritems
from flask import json, jsonify
from flask import Response
import datetime
import calendar
import math
# import jwt.jwa
# from jwt import jwa
import itsdangerous
import time
import re... | null | python-flask-server/swagger_server/utitl/meter_date_insert.py | meter_date_insert.py | py | 4,101 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Jwts.jwt_s.getGroupMeter",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "Jwts.jwt_s",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "Jwts.jwt_s.getRealTime",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "Jwts.jwt_s... |
20675133 | import pickle
from core.prepo import *
from tqdm import tqdm
def random_batch(data, size):
random_inputs = []
random_labels = []
random_index = np.random.choice(range(len(data)), size, replace=False)
for i in random_index:
random_inputs.append(data[i][0]) # target
random_labels.append... | null | CODE/word2vec_word.py | word2vec_word.py | py | 2,929 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pickle.load",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 94,
"usage_type": "call"
}
] |
33133158 | import abc
import smtplib
import ssl
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from slack import WebClient
from slack.errors import SlackApiError
import logging
slackLogger = logging.getLogger("slack")
emailLogger = logging.getLogger("email")
class NotifierInterface(metaclas... | null | notify.py | notify.py | py | 2,360 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "abc.ABCMeta",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmeth... |
170223899 | import math
import time
import matplotlib.pyplot as plt
from perceptron import PerceptronClassifier
from samples import Samples
class DataClassifier:
def __init__(self, imgHeight, imgWidth, LABELS, pixelChars):
if pixelChars is None:
pixelChars = ['#', '+']
self.pixelGrid = 1
... | null | dataclassifier.py | dataclassifier.py | py | 5,218 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "math.ceil",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "samples.Samples",
"line_number": 104,
"usage_type": "call"
},
{
"api_name": "perceptron.PerceptronClassifier",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "samples.r... |
448169863 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import re
import lxml.etree as etree
import datetime as dt
import django
import platform
if platform.node() == "srv-mcc-apsis":
sys.path.append('/home/leey/tmv/BasicBrowser/')
xml_path = "/home/leey/plpr-scraper/data/19wahlperiode/"
elif plat... | null | scraper/wp19_parser.py | wp19_parser.py | py | 13,797 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "platform.node",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "platform.node",
"line... |
19734809 | # Copyright 2018 The Chromium 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 os
import shutil
import tempfile
from tracing.mre import map_single_trace
_GET_TIMELINE_MARKERS = """
function processTrace(results, model) {
v... | null | src/third_party/catapult/telemetry/telemetry/util/trace_processor.py | trace_processor.py | py | 3,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tempfile.mkdtemp",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "tracing.mre.map_single_tra... |
58497803 | from Nomina.models import Cargo, Empleado, FotosEmpleado
from django import forms
from django.forms import ModelForm, Textarea
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, Row, Column
from datetime import datetime
class DateInput(forms.DateInput):
input_type = "date"
... | null | Nomina/forms.py | forms.py | py | 2,936 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.forms.DateInput",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.forms.TimeInput",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "dj... |
40038925 | from typing import List
class Solution:
def containsDuplicates(self, list):
found = []
for item in list:
if item not in found:
found.append(item)
else:
return True
return False
def validRows(self, board: List[List[str]]):
... | null | interview-questions-easy/arrays/valid-sudoku.py | valid-sudoku.py | py | 1,503 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
490802113 | """Find translation keys that are in Lokalise but no longer defined in source."""
import json
import pathlib
import sys
import requests
INTEGRATION_DIR = pathlib.Path("homeassistant/components")
PROJECT_ID = "130246255a974bd3b5e8a1.51616605"
class Lokalise:
"""Lokalise API."""
def __init__(self, project_id... | null | script/translations_clean.py | translations_clean.py | py | 3,290 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.request",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number... |
550996829 | import cv2 as cv
import time
import numpy as np
def process_image():
img = cv.imread("image.png")
height, width = img.shape[:2]
new_img = np.empty((height, width, 3), np.uint8)
n = 1
for k in range(n):
for i in range(1, height - 1):
for j in range(1, width - 1):
... | null | Python/src/noise_filter/noise_filter.py | noise_filter.py | py | 934 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.imwrite",
"line_number... |
517044707 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Django imports
from django import http
from django.utils.translation import ugettext_lazy as _
# Devilry/cradmin imports
from devilry.apps.core import models as core_models
from devilry.devilry_account import models as account_models
from devilry.devil... | null | devilry/devilry_group/views/admin/feedbackfeed_admin.py | feedbackfeed_admin.py | py | 3,567 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "devilry.devilry_group.views.cradmin_feedbackfeed_base.FeedbackFeedBaseView",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "devilry.devilry_group.views.cradmin_feedbackfeed_base",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django_crad... |
442852051 | from keras.models import load_model
import numpy as np
import cv2
model = load_model("model.h5")
data_type = "Testing"
emotion_class = ["Happy", "Neutral"] # 兩類情緒(Happy and Neutral)
img_num = 10 # 測試資料有10張
img_size = 160 # 影像大小160x160
# np.zeros 初始一個全為0的矩陣, 大小為兩類情緒, 影像大小160x160, RGB 3個色彩通道
x_test = np.zeros((1, im... | null | test.py | test.py | py | 1,892 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.models.load_model",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_... |
165838345 | import numpy as np
import cv2
import dlib
from ast import literal_eval
import os
import time
class FaceDataCreator:
def __init__(self):
self.saveCount = 1
self.saveNum = 500
self.faceDetection = dlib.get_frontal_face_detector()
self.shapeDetection_path = '../face_detection/shape_p... | null | face_recognition/face_data_creator.py | face_data_creator.py | py | 3,751 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "dlib.get_frontal_face_detector",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "dlib.shape_predictor",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.... |
360919029 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import webview
from time import sleep
from server import run_server
import config
from threading import Thread, Lock
from loggerops import create_logger
socketio = config.socketio
server_lock = Lock()
logger = logging.getLogger(__name__)
logging.getLogge... | null | main.py | main.py | py | 2,099 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "config.socketio",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.getLogg... |
603048973 | # Task 3 : Training the ML model with the train data and later testing the model with the test data
# Importing the models and layers and ImageDataGenerator from Keras
# Keras uses Tensorflow as its backend.
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D, Flatten, Dense
from ... | null | Task 3/Task3.py | Task3.py | py | 3,859 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "keras.models.Sequential",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "keras.layers.Convolution2D",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "keras.layers.MaxPooling2D",
"line_number": 30,
"usage_type": "call"
},
{
"api_... |
327667452 | import sys
import matplotlib.pyplot as plt
import numpy as np
import time
import pickle
fig,ax=plt.subplots(num=0)
plt.xlabel('Time [ms]')
Y1=np.arange(-4.0e-3,0,0.1e-3)
Y2=np.arange(0,4.01e-3,0.1e-3)
Y=np.append(Y1,Y2)
for YY in Y:
ZZ=0
fname='./APs,{:.2f},{:.2f},{:.0f},{:.6f}.p'.format(2000,5,10... | null | Scripts/Figure6/Figure6A.py | Figure6A.py | py | 974 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "ma... |
72895407 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from typing import List, Optional, Tuple
from gensim.models import Word2Vec
from allennlp.commands.elmo import ElmoEmbedder
from preprocess.corpora import Dictionary
import numpy as np
class BagOfWordVectors(object):
def __init__(self, model_word2vec: Word2Vec, init_... | null | encoder/unsupervised.py | unsupervised.py | py | 11,437 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "gensim.models.Word2Vec",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"lin... |
7847483 | # Primary python script
# Workflow: access card library on cardgamedb.com and gather the card
# information, translating it into information that can be imported
# into a database.
import requests
from bs4 import BeautifulSoup
import csv
import re
core_url = 'http://www.cardgamedb.com/index.php/agameofthrones2ndedit... | null | scraper/scraper.py | scraper.py | py | 3,663 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.