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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
118198518 | from darkflow.net.build import TFNet
import cv2
import os
import glob
import shutil
import copy
import numpy as np
import sys
#let these be user configurations?
direction = 1 #assuming 0 = left, 1 = right
fps = 60 #number of frames taken per second
length = 50 #distance of the entire length of the frame horizontally
s... | null | demo.py | demo.py | py | 7,542 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "darkflow.net.build.TFNet",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle... |
605873820 | import json
import logging
import re
from pyhocon import ConfigFactory, HOCONConverter
from .dict_tool import merge_dict
logger = logging.getLogger(__name__)
class HOCONString:
RE_INCLUDE_LINE = r'^\s*include\s'
def __init__(self, hocon_str):
"""Splits HOCON string into "include" lines and the res... | null | caper/hocon_string.py | hocon_string.py | py | 2,057 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pyhocon.ConfigFactory.from_dict",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pyhocon.C... |
489778712 | # coding=UTF-8
# **********************************************************************
# Copyright (c) 2013-2020 Cisco Systems, Inc. All rights reserved
# written by zen warriors, do not modify!
# **********************************************************************
from cobra.mit.meta import ClassMeta
from cobra.m... | null | venv/Lib/site-packages/cobra/modelimpl/proc/proc.py | proc.py | py | 11,179 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cobra.mit.mo.Mo",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "cobra.mit.meta.ClassMeta",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cobra.model.category.MoCategory.REGULAR",
"line_number": 32,
"usage_type": "attribute"
},
{
... |
272883399 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import rospy
import math
import random
import itertools
import heapq
# Robot motion commands:
# http://docs.ros.org/api/geometry_msgs/html/msg/Twist.ht... | null | src/ros/prioritised_path.py | prioritised_path.py | py | 22,748 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "numpy.empty_like",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
... |
576561260 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ufundi', '0008_auto_20141121_1555'),
]
operations = [
migrations.AlterModelOptions(
name='subcategory',
... | null | ufundi/migrations/0009_auto_20141201_1735.py | 0009_auto_20141201_1735.py | py | 1,232 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AlterModelOptions",
"line_number": 14,
"usage_type": "call"
... |
415705332 | import json
import traceback
import iota.harness.api as api
def get_error_messages(resp):
err_msgs = [error["Message"].lower() for error in resp.obj['error']['@Message.ExtendedInfo'] if error["Message"]]
return err_msgs
def validate_resp(resp):
if resp.status == 400:
try:
api.Logger.e... | null | iota/test/utils/redfish/response.py | response.py | py | 832 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "iota.harness.api.Logger.error",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "iota.harness.api.Logger",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "iota.harness.api",
"line_number": 13,
"usage_type": "name"
},
{
"api_n... |
32647213 | import os
import sys
from shutil import copyfile
import h5py
import numpy as np
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from ClassArch.dataset import UnlabeledModelNet40Dataset
from ClassArch.model.PointNet import PointNet
from ClassArch.ut... | null | ClassArch/teacher_run.py | teacher_run.py | py | 1,783 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "ClassArch.utils.data_utils.PointcloudToTensor",
"line_number": 19,
"usage_type": "c... |
375486285 | import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.colors as colors
import numpy as np
import colores as c
import random
phi=(1+np.sqrt(5))/2
cbase='#58ACFA'
#cbase='#fe4a5e'
v=c.desnormalizar(colors.hex2color((cbase)))
#v=[random.randint(0, 255) for i in range(3)]
color1=c.colores... | null | test_colores.py | test_colores.py | py | 1,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "colores.desnormalizar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.colors.hex2color",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotli... |
131301067 | import xml.etree.ElementTree as ET
import argparse
import datetime
import logging
import socket
import sys
import re
import os.path
from openpyxl import Workbook
# logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s', filename='xml.log', filemode='w', level=logging.DEBUG)
logging.basicConfig(format='%... | null | test.py | test.py | py | 10,050 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "xm... |
556469274 | #### made by: rtuna#4321 | @rTunaboss
#### Working on Python 3.8.0
#################### Settings [Feel free to modify this] ####################
jigFirstAndLast = False #or True
jigFirst = False #or True
jigPhone = True #or False
jigSecondLineAddress = True #or False
jigFirstLineAddress = True #o... | null | soleboxaccgen.py | soleboxaccgen.py | py | 19,426 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "colorama.init",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "colorama.Fore.YELLOW",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "colorama.Fore",
"line_number": 52,
"usage_type": "name"
},
{
"api_name": "threading.Lock"... |
60463306 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""
Batch acquisition functions using the reparameterization trick in combination
with (quasi) Monte-Carlo sampling. S... | null | botorch/acquisition/monte_carlo.py | monte_carlo.py | py | 16,368 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "acquisition.AcquisitionFunction",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "models.model.Model",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Opt... |
115809170 | from django.test import TestCase
from ..models import District
from ..constants import HOUSE, SENATE, INTERIM
from .test_urls import *
from .test_views import *
DUMMY_DISTRICT_NUMBER = 201
DUMMY_REPRESENTATIVE = 'Test Representative'
class DummyBackend(object):
def get_representative(self, district):
if... | null | tx_lege_districts/tests/__init__.py | __init__.py | py | 2,361 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.District",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "models.District",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "constants.HOUSE"... |
344211143 | from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import (
UserRegisterForm,
ProfileRegisterForm,
UserUpdateForm,
ProfileUpdateForm
)
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
def register(request):
... | null | djP2/users/views.py | views.py | py | 1,802 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.UserRegisterForm",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "forms.ProfileRegisterForm",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.filter",
"line_number": 19,
"usage_type": "call"... |
425769582 | from .server import app, template
from aiohttp import ClientSession
from bs4 import BeautifulSoup
@app.route("/habr/<id_>")
@template("habr.html")
async def habr(request, id_):
async with ClientSession() as session:
res = await session.get(f"https://habr.com/ru/post/{id_}/")
soup = BeautifulSoup(... | null | server/habr.py | habr.py | py | 581 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "server.app.route",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "server.app",
... |
563347439 | from django.shortcuts import render
from django.conf import settings
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from tworaven_apps.user_workspaces.utils import get_latest_user_workspace
from django.contrib.auth.decorators import login_required
from tworaven_apps.image_ut... | null | tworaven_apps/image_utils/views.py | views.py | py | 1,850 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tworaven_apps.utils.view_helper.get_request_body_as_json",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "tworaven_apps.utils.view_helper.get_json_error",
"line_numb... |
112780638 | from __future__ import unicode_literals, print_function
import pickle
import random
import spacy
from pathlib import Path
from spacy.training import Example
from spacy.util import minibatch, compounding
"""
geo = Geographical Entity
org = Organization
per = Person
gpe = Geopolitical Entity
tim = Time indicator
art =... | null | spacy_ner_custom_entities.py | spacy_ner_custom_entities.py | py | 3,494 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "spacy.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "spacy.load",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "spacy.blank",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_number":... |
382767269 | # -*- coding:utf-8 -*-
# @Author: yanghao
# @Create time: 2021/08/20 09:11
# @Description: 聚类算法及其评估模块, 包含:
# class clustering():
# 内置 kmeans(), 自定义距离的 kmeans: kmeans_sd(), 高斯混合模型 GMM(), 层次聚类 Hierarchy(),
# 启发式聚类 spectral(), 密度聚类 DBSCAN(), BIRCH().
# class evaluate():
# 内置 内部指标评估:... | null | machine_learning/clustering_utils.py | clustering_utils.py | py | 8,473 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pyclustering.clu... |
556983039 | import matplotlib.pyplot as plt
import numpy as np
import sys
print(sys.argv)
drf = np.loadtxt(sys.argv[1])
auction = np.loadtxt(sys.argv[2])
plt.xlabel("time (in hours)")
plt.ylabel("CPU utilization")
plt.title("Utilization of auctions vs. DRF (light workload)")
#plt.axis([0,180000/3600,0,1])
plt.rc('font', size=18)
... | null | image_2/plot.py | plot.py | py | 1,012 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_numb... |
171374488 | from flask import render_template, url_for, request, json
from app import app, util
import re
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/player', methods=['POST'])
def getPlayerTweets(tweetText):
# Initialize naive bayes classifier
nb = util.initClassifier(a... | null | External/FantasyFootballRecommender-master/app/views.py | views.py | py | 3,121 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "app.app.route",
"line_nu... |
140901547 | #!/usr/bin/python
#--------------------------------------------#
#SEE EXPLANATION BELOW FOR MORE DETAILED HELP#
#--------------------------------------------#
import pymongo
from pymongo import MongoClient
#Connect to the database
#This is using MongoClient which is the NEW method of connection to the database
conne... | null | week2/hw2-2.py | hw2-2.py | py | 4,025 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pymongo.ASCENDING",
"line_number": 23,
"usage_type": "attribute"
}
] |
151653101 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Correlates market sentiment from twitter with stock market price data.
@author: Euan Judd
@github: https://github.com/euanjudd/market-sentiment
"""
import pandas as pd # for working with datasets
import datetime as dt # fo... | null | main.py | main.py | py | 2,615 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pan... |
222348377 | from typing import List
import config
from xbox_live import models
from aiohttp import ClientSession
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.authentication.manager import AuthenticationManager
from xbox.webapi.authentication.models import OAuth2TokenResponse
XBOX_STATE_ONLINE = 'Online'
... | null | xbox_live/client.py | client.py | py | 2,393 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "aiohttp.ClientSession",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "xbox.webapi.api.client.XboxLiveClient",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 21,
"usage_type": "call"
},
{
... |
386031071 | # Written by Rudy Pikulik 07/17
import pickle
from rocketchat_API.rocketchat import RocketChat
import time
from Structures.Queue import Queue
import RedditSilverRobot
from datetime import datetime
print("Starting up the bots!")
rocket = RocketChat('johanna', 'Passord1', server_url='http://rocketchat-rocket-chat.clus... | null | RedditBotCore/StartBots.py | StartBots.py | py | 1,538 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rocketchat_API.rocketchat.RocketChat",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "Structures.Queue.Queue",
"line_number": 31,
"usage_type": "call"
},
{
"api_name"... |
99707739 | from collections import Counter
def isValidWalk(walk):
directions = list(walk)
if len(directions) != 10:
return False
else:
number = Counter(directions)
nb_n = number['n']
nb_s = number['s']
nb_w = number['w']
nb_e = number['e']
if nb_n == nb_s and n... | null | walk.py | walk.py | py | 383 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.Counter",
"line_number": 9,
"usage_type": "call"
}
] |
335516737 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Resource(models.Model):
# Varialbes are named after terms in ARN
# http://docs.aws.amazon.com/general/... | null | inventory/models.py | models.py | py | 1,910 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": ... |
624348304 | #5. Crie um programa que leia nome,
#ano de nascimento e carteira de trabalho
#e cadastre-os (com idade) em um dicionário.
#Se por acaso a CTPS for diferente de 0,
#o dicionário receberá também o ano de
#contratação e o salário. Calcule e acrescente,
#além da idade , com quantos anos a pessoa vai
#se aposenta... | null | Aula 13 - Dicionários/Ex05.py | Ex05.py | py | 996 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetim... |
4583962 | import datetime
import typing as t
from typing_extensions import Protocol
from apd.aggregation.database import DataPoint
# Aliases for common types
# These type variables allow for generic functions. T_key represents the place
# in a chart that an item will be placed, and T_value the kind of data that is plotted.
T_... | null | src/apd/aggregation/typing.py | typing.py | py | 2,287 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.TypeVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.TypeVar",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.AsyncIterator",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple"... |
206378942 | import os
import numpy as np
from PIL import Image, ImageEnhance, ImageFilter
from sklearn.externals import joblib
import sys
import os
def load_images(img_path):
"""
基于给定的图像路径,加载图像数据
:param img_path:
:return:
"""
imgs_enhance = []
# 获取图片
image = Image.open(img_path)
# 汉字识别不会受颜色影响... | null | 2019/AI/MachineLearning/SVM/05_ImagePredict.py | 05_ImagePredict.py | py | 2,524 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PIL.Image.open",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFilter.CONTOUR",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFilter... |
389904398 | # Plane.py
#
# contains the Plane class
#
from lib.game import Item
from lib.game import Body
from lib import Common
plane_id = 0
class Plane:
# the Plane class
#
# >> available methods:
#
# .getters/setters. .returns/expects type.
# get/set_name str
#
# >> constr... | null | lib/game/Plane.py | Plane.py | py | 2,261 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lib.game.Item.Item",
"line_number": 71,
"usage_type": "attribute"
},
{
"api_name": "lib.game.Item",
"line_number": 71,
"usage_type": "name"
},
{
"api_name": "lib.Common.debug",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "lib.Common",
... |
502623968 | import functools
import logging
from app.routes.humidity.schema import HumidityRequest
from app.routes.relay.job import action
from app.routes.relay.schema import Relay
from app.routes.sensor.crud import get_sensors_by_attribute
from app.routes.temperature.schema import TemperatureRequest
from app.utils.scheduler.sche... | null | app/routes/settings/job.py | job.py | py | 3,467 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "app.routes.sensor.crud.get_sensors_by_attribute",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "app.routes.sensor.crud.get_sensors_by_attribute",
"line_number": 32,
"u... |
420783563 | # 데이터 출처: kaggle
# 데이터 개요: 511, 유리를 위한 다양한 속성(화학원소)들로부터 type 구별
# 데이터 예측 모델: 이진클래스
# 적용 머신러닝 모델: 깊은 다층 퍼셉트론 신경망
# 훈련 데이터셋: 160건
# 검증 데이터셋: 건
# 시험 데이터셋: 수집데이터로서 시험셋을 확보할 수 없으므로 고려하지 않음
# 입력 데이터: 10개 항목의 데이터
# 은닉층: 2개
# 사용한 활성화 함수
# - 제1 은닉층: Relu
# - 제2 은닉층: Relu
# - Output Layer: Softmax
# 사용한 손실함수: categorical_cros... | null | python_workspace/3_bigdata/04_AI/03. Deep Learning/3. Keras/김혜경_머신러닝분석_to.신경망.py | 김혜경_머신러닝분석_to.신경망.py | py | 3,265 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.seed",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
330292088 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import Tool_Functions.Functions as Functions
import os
import math
import random
np.set_printoptions(precision=10, suppress=True)
epsilon = 0.001
class GetRim(nn.Module):
def __init__(self):
super(GetRim, self).__init__... | null | sample_manager/loss_weight_cal.py | loss_weight_cal.py | py | 37,613 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.FloatTenso... |
230040772 | __author__ = 'charlesztt'
import xml.etree.cElementTree as ET
import os
event_mention_list=list()
for one_file in os.listdir('./data/ie_data/isis_jan_feb'):#os.listdir('../../data/annotation_data'):
if '.xml' not in one_file:
continue
tree=ET.parse(os.path.join('./data/ie_data/isis_jan_feb',one_file)... | null | python/system/coreference_ranking.py | coreference_ranking.py | py | 2,705 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree.parse",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "os.path... |
474546047 | #from screens import menu
from collections import deque
from ai import adversarial_search, utils, heuristic
import objects
import pygame
import settings
import utils
import logging
import sys
import json
class Game:
def __init__(self, app):
logging.info('Initializing game')
self.app = app
... | null | screens/game.py | game.py | py | 20,105 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.info",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.Group",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "collections.deque... |
4739761 | # Create your views here.
from django.shortcuts import render
from quiz.models import Answer, Question
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
def start(request):
return render(request, 'index.html')
def check(request):
question = Question.objects.get(pk=1)
... | null | 2_quiz/course_project/quiz/views.py | views.py | py | 803 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.shortcuts.render",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "quiz.models.Question.objects.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "quiz.models.Question.objects",
"line_number": 13,
"usage_type": "attribute"
},
... |
377936721 | import os
import zipfile
def append_files_to_zip_file(file_paths, zip_file_path):
# Append all of the provided files to the specified zip file.
with zipfile.ZipFile(zip_file_path, "a", compression=zipfile.ZIP_DEFLATED, allowZip64=True) as zip_file:
for file_path in file_paths:
archive_nam... | null | usaspending_api/download/filestreaming/zip_file.py | zip_file.py | py | 404 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "zipfile.ZipFile",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "zipfile.ZIP_DEFLATED",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
323579041 | # -*- coding: utf-8 -*-
# Project: Olive Finance
# Description: Stock工具类
# Module:
# Copyright: Copyright (c) 2013
# Company: Olive Software
# @author Richard
# @version 0.1
#
#*************************************************************
# Create: 2013-11-26
#*************************... | null | olive/finance/spider.py | spider.py | py | 3,757 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "urllib.request.request.urlopen",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "urllib.request.request",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "urllib.request",
"line_number": 30,
"usage_type": "name"
},
{
"api_nam... |
133214393 | from wopmars.framework.database.tables.ToolWrapper import ToolWrapper
# import models
import wopexamplesnp.model.SNP
import pandas
from sqlalchemy import select
class InsertPhenotype(ToolWrapper): # inherit WopMars
__mapper_args__ = {'polymorphic_identity': __name__}
__input_file_snp2phenotype = "snp2phenoty... | null | wopmars/example/wopmars_example_snp/wopexamplesnp/wrapper/pandas/InsertPhenotype.py | InsertPhenotype.py | py | 1,780 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wopmars.framework.database.tables.ToolWrapper.ToolWrapper",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pandas.read_table",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.select",
"line_number": 34,
"usage_type": "call"
... |
598662274 | # -*- coding: utf-8 -*-
import datetime
from decimal import Decimal
from pymysqlreplication.row_event import (
DeleteRowsEvent,
UpdateRowsEvent,
WriteRowsEvent,
)
from pymysqlreplication.event import RotateEvent,QueryEvent
from pymysqlreplication import BinLogStreamReader
from config import mysql_settings... | null | utils.py | utils.py | py | 1,193 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysqlreplication.BinLogStreamReader",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "config.mysql_settings",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pymysqlreplication.row_event.DeleteRowsEvent",
"line_number": 22,
"usage_type... |
246919318 | import pandas as pd
import numpy as np
from sklearn.linear_model import Lasso
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import roc_auc_score
from matplotlib import pyplot as plt
from sklearn.linear_model import Lasso, LassoCV
from sklearn.model_selection import GridSearchCV
train = pd.read_... | null | visualize.py | visualize.py | py | 1,282 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing... |
173213276 | from collections import defaultdict, deque, Counter
import itertools
import math
import sys
def main():
n = int(input())
links = defaultdict(list)
for _ in range(n):
node, hash_id = input().split()
links[node].append(hash_id)
by_ends = defaultdict(list)
for node in links:
b... | null | codecon/nov17/hash.py | hash.py | py | 1,250 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 17,
"usage_type": "call"
},
{
"api_name":... |
255460166 | import wx
class ColorSchemeDialog(wx.Dialog):
def __init__(self, parent, color_schemes):
wx.Dialog.__init__(self, parent, wx.NewId(), 'Color Scheme Chooser')
self.parent = parent
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.AddSpacer((10,20))
group = wx.RadioButton(sel... | null | app/doctemplate_nsga/colorschemedlg.py | colorschemedlg.py | py | 1,618 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wx.Dialog",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "wx.Dialog.__init__",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "wx.Dialog",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "wx.NewId",
"line_nu... |
650418874 | # Importando o networkx para manipular os grafos
import networkx as nx
# Importando a biblioteca de algoritmos do networkx
from networkx.algorithms import approximation as approx
linha = input()
numCartas = int(linha)
linha = input()
valorCartas = linha.split(" ")
# Criando o grafo
G = nx.Graph()
# ... | null | 5th/LPA/TPs/TP dos meninos/Lab0702.py | Lab0702.py | py | 1,110 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.Graph",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "networkx.get_node_attributes",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "networkx.shortest_path_length",
"line_number": 46,
"usage_type": "call"
}
] |
444142363 | import time
import can
from adc import *
def CAN_tx_task(pipe):
while(1):
trama = pipe.recv()
bus = can.interface.Bus(channel = 'can0', bustype = 'socketcan_native')
msg = can.Message(arbitration_id=trama.id,
data=[trama.data[0],trama.data[1]])
try:
... | null | PythonProject/canScript.py | canScript.py | py | 414 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "can.interface.Bus",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "can.interface",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "can.Message",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "can.CanError",
"li... |
487821385 | from django.contrib import admin
from django.urls import path
from content import views
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('', views.index, name='index'),
path('courses', views.courses, name='courses'),
path('teachers', views.teachers, name='tea... | null | airport/urls.py | urls.py | py | 766 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "content.views.index",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "content.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.path... |
124110735 | #!/usr/bin/env python
# coding=utf8
# Copyright (c)2009 Sean Langley. Some rights reserved.
# portions Copyright (C) 2006-2009 Eric Florenzano from the following website:
# http://www.eflorenzano.com/blog/post/writing-markov-chain-irc-bot-twisted-and-python/
#
# see the accompanying LICENSE file
import argparse
from... | null | deathbotirc.py | deathbotirc.py | py | 12,553 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "string.strip",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "random.choice",
"lin... |
437398642 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0006_auto_20151021_2028'),
]
operations = [
migrations.AddField(
model_name='userprofile',
... | null | stars/apps/accounts/migrations/0007_auto_20151021_2127.py | 0007_auto_20151021_2127.py | py | 713 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.db.migrations.Migration",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.migrations",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.migrations.AddField",
"line_number": 14,
"usage_type": "call"
},
{
... |
217920063 | # import pandas as pd
#
# # file = pd.read_excel("EQProfile_20201119.xlsx", sheet_name="Alarm")
# # print(file, type(file))
# # #
# # #
# # def zhhex(vol):
# # data = hex(vol).replace("0x", "").upper()
# # return data
# #
# #
# # file["Alarm CODE"] = file["Alarm CODE"].apply(zhhex)
# # # print(file, type(file))... | null | GS/venv/进制.py | 进制.py | py | 3,227 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xlwings.App",
"line_number": 65,
"usage_type": "call"
}
] |
113103507 | import torch
import torchvision.transforms as transforms
from avalanche.benchmarks.classic import SplitMNIST
from avalanche.logging import TensorboardLogger, TextLogger, InteractiveLogger
from avalanche.training.plugins import EvaluationPlugin
from avalanche.evaluation.metrics import (
accuracy_metrics,
timing... | null | code-submission/gwr_avalanche_integration.py | gwr_avalanche_integration.py | py | 2,727 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 21,
"usage_type": "call"
},
{
... |
627877901 | import copy
import io
import itertools
import logging
import os
import re
from builtins import str as ustr
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
import py
import attr
import pytest
import yaml
from _pytest import fixtures
from _pytest._cod... | null | tavern/testutils/pytesthook.py | pytesthook.py | py | 26,979 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "tavern.util.general.load_global_config",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "b... |
402015499 | from collections import defaultdict
from django.db import IntegrityError
import requests
from lxml.etree import tounicode
from breadability.readable import Article as ReadableArticle
from .models import Article, Origin, ARTICLE_STATUS
class FailedToCreateArticle(Exception):
pass
def parse_meta_data(doc):
... | null | catalog/article.py | article.py | py | 4,795 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "requests.HTTPError",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "requests... |
182029773 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dataset=pd.read_csv('Credit_Card_Applications.csv')
X=dataset.iloc[:,:-1].values
y=dataset.iloc[:,-1].values
X=X[:,1:]
from sklearn.preprocessing import MinMaxScaler
sc=MinMaxScaler()
X=sc.fit_transform(X)
from minisom import MiniSom
som=MiniSom(... | null | som.py | som.py | py | 952 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "minisom.MiniSom",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyl... |
573781025 | from utils import print_important
from random import randint
from song import Song
from midi import Midi
from model import Model
import argparse
NOTES_LENGTH = 100
parser = argparse.ArgumentParser(
description='Piano bot')
parser.add_argument('-l', '--learn', action='store_true',
default=Fa... | null | program.py | program.py | py | 3,136 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "utils.print_important",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "midi.Midi",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "utils.print_i... |
233268655 | # uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build/bdist.linux-x86_64/egg/ztfy/security/indexer.py
# Compiled at: 2012-06-20 11:58:15
from zope.annotation.interfaces import IAnnotatable
from ztfy.security.i... | null | pycfiles/ztfy.security-0.4.3-py2.7/indexer.py | indexer.py | py | 1,442 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "zope.component.adapts",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "zope.annotation.interfaces.IAnnotatable",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "zope.interface.implements",
"line_number": 18,
"usage_type": "call"
}... |
403124260 | import json
def open_json_file(filename):
with open(filename, encoding='UTF8') as file:
try:
return json.load(file)
except ValueError as e:
print("JSON 데이터를 파싱하는 데 실패했습니다. 사유={0}".format(e))
return None
# message1.json 파일은 같은 디렉터리에 있어야 한다.
json_... | null | python-17techs/Chapter_2/08_JSON/open_json_file.py | open_json_file.py | py | 490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
}
] |
38535911 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
from .stage0 import Stage0
from .stage1 import Stage1
class AlexNetSplit(torch.nn.Module):
def __init__(self):
super(AlexNetSplit, self).__init__()
self.stage0 = Stage0()
self.stage1 = Stage1()... | null | runtime/image_classification/models/alexnet/gpus=16/alexnet.py | alexnet.py | py | 447 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "stage0.Stage0",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "stage1.Stage1",
"line_number": 12,
"usage_type": "call"
}
] |
320887873 | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APIRequestFactory
from django.test.client import RequestFactory
from .models import Product
from .viewsets import ProductViewSet
class ApiTests(APITestCase):
def setUp(self... | null | api/tests.py | tests.py | py | 4,659 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Product.objects.bulk_create",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.Product.objects",
"line_number": 15,
"usage_type": "attribute"
... |
70447927 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010-2011 OpenStack, LLC.
#
# 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
#
# Unl... | null | stack/keystone/keystone/server.py | server.py | py | 1,949 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keystone.routers.service.ServiceApi",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "keystone.routers.admin.AdminApi",
"line_number": 68,
"usage_type": "call"
}
] |
644782665 | import requests
import json
class API():
def sudoku9x9(self):
self.api = requests.get('http://www.cs.utep.edu/cheon/ws/sudoku/new/?level=1&size=9')
self.matriz = []
for i in range (9):
self.matriz.append(["x"]*9)
for item in self.api.json()["squa... | null | api.py | api.py | py | 807 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 23,
"usage_type": "call"
}
] |
148789857 | # -*- coding: utf-8 -*-
import scrapy
from Tencent.items import TencentItem
class TencentSpider(scrapy.Spider):
name = 'tencent'
allowed_domains = ['hr.tencent.com']
start_urls = [
'https://hr.tencent.com/position.php?lid=2156&tid=87&keywords=python']
def parse(self, response):
trs = ... | null | Scrapy/day3/Tencent/Tencent/spiders/tencent.py | tencent.py | py | 1,371 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Tencent.items.TencentItem",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 36,
"usage_type": "call"
}
] |
173381845 | import sys
import os
import pysftp
import csv
delivered_suffix = '_Delivered Prod'
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
output_dir = '\\\\stria-prod1\\CID01559 - jamf\\JID01157 - CaaS for Contracts into SpringCM\\Output'
def deliver_dir(dir, sftp):
remote_dir = '/Admin/Stria Deliveries'
... | null | main.py | main.py | py | 1,698 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pysftp.CnOpts",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,... |
581253674 | import numpy as np
import control
from scipy import signal
import matplotlib.pyplot as plt
def get_bands():
return np.array([[0, 170],
[170, 310],
[310, 600],
[600, 1000],
[1000, 3000],
[3000, 6000],
... | null | helper_method.py | helper_method.py | py | 3,680 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "scipy.signal.firwin",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_n... |
46226539 | """
Functions for nonparametic regression
"""
# Import dependencies
import numpy as np
import numba
from sklearn import preprocessing
from nonparaecon import kernels
from _warnings import warn
# Define squared error loss
# defining squared loss
def l2loss(yhat, yactual):
"""
Return the sum of squared errors ... | null | nonparaecon/npregression.py | npregression.py | py | 40,980 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ndim",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.isscalar",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "numpy.ndim",
"line_number":... |
157137530 | #!/usr/bin/env python3
# encoding utf-8
from DiscreteHFO.HFOAttackingPlayer import HFOAttackingPlayer
from DiscreteHFO.Agent import Agent
import argparse
import numpy as np
class SARSAAgent(Agent):
def __init__(self, learningRate, discountFactor, epsilon, initVals=0.0):
super(SARSAAgent, self).__init__()
self.le... | null | SARSABase.py | SARSABase.py | py | 4,062 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "DiscreteHFO.Agent.Agent",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.random.uniform",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "numpy.a... |
26577308 | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
__all__ = ("find_substring_regex",)
import awkward as ak
from awkward._behavior import behavior_of
from awkward._dispatch import high_level_function
from awkward._layout import wrap_layout
@high_level_function(module="ak.str")
... | null | src/awkward/operations/str/akstr_find_substring_regex.py | akstr_find_substring_regex.py | py | 2,297 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "awkward._dispatch.high_level_function",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "awkward._connect.pyarrow.import_pyarrow_compute",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "awkward.to_layout",
"line_number": 51,
"usage_type"... |
372013087 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
url = r"C:\Users\HP\Desktop\2020_04_10_Datas_Analysis_python\data\imports-85.data"
df = pd.read_csv(url, header = None,na_values="?")
print (df.head(2)) #Head filter data selecting the df.head(n) n first rows
print (df.tail(2)) #Head filter... | null | scripts/import_file.py | import_file.py | py | 3,943 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.linspace",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "pandas.cut",
"line_n... |
110259461 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests, os, sys
from datetime import datetime
VERBOSE = True
DATAPATH = os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." + os.sep + ".." + os.sep + "data_HE" + os.sep
DATE_STR = datetime.fromtimestamp(datetime.now().timestamp()).strftime('%Y-%m-%d')
D... | null | .github/workflows/download_HE.py | download_HE.py | py | 1,441 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.sep",
"line_number":... |
140023576 | # API KEY 14c3fe61be5b4f5a87820c702eb67659
import concurrent.futures
import os
import re
from datetime import datetime, timedelta
from itertools import cycle
from typing import List
import pandas as pd
from bs4 import BeautifulSoup
import requests as requests
from app_logger import get_logger
api = '14c3fe61be5b4f5a... | null | src/lab16/parse.py | parse.py | py | 8,614 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app_logger.get_logger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 91,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "datetime.datetim... |
488609812 | """
ShopCarts Service
<Describe what your service does here>
Paths:
DELETE /shopcarts/{id}/items/{id}
"""
import os
import sys
import logging
from flask import Flask, jsonify, request, url_for, make_response, abort
from flask_api import status # HTTP Status Codes
# For this example we'll use SQLAlchemy, a popula... | null | service/service.py | service.py | py | 11,848 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "service.models.DataValidationError",
"line_number": 29,
"usage_type": "argument"
},
{
"api_name": "flask.jsonify",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "flask_api.status.HTTP_400_BAD_REQUEST",
"line_number": 42,
"usage_type": "attribute"... |
615892167 | """
Module for interaction with a current table in a database.
"""
from datetime import datetime
from MySQLdb._exceptions import IntegrityError
from core.db.db_helper import DbHelper
class Current(DbHelper):
"""
Model for interacting with a current table in a database.
"""
@staticmethod
def crea... | null | moneta/src/python/db/current.py | current.py | py | 6,959 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "core.db.db_helper.DbHelper",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "My... |
594979405 | import requests
def main():
host = '192.168.15.19'
url = 'http://{}:5000/'.format(host)
response = requests.post(
url,
files = { 'file' : ('test.png', capture_image()) }
)
def capture_image():
import io
import photos
image = photos.capture_image()
b = io.BytesIO()
... | null | cantor/client/main.py | main.py | py | 417 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.post",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "photos.capture_image",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 19,
"usage_type": "call"
}
] |
468269018 | # -*- coding: utf-8 -*-
"""
Twitch Tests
"""
from django.test import TestCase
import twitch.views, re
from youtube import YouTube
class TestYoutube(TestCase):
"""Test class for Youtube.py"""
def test_popular_games_instance(self):
"""Test if instantiated obj is YouTube obj"""
youtube = YouTube()... | null | amateur_sports_announcers/twitch/tests.py | tests.py | py | 3,791 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "youtube.YouTube",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "youtube.YouTube",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "youtube.YouTu... |
328824031 | from keras.models import Sequential, load_model
from keras.layers import Dense, Bidirectional, Masking, GRU, Embedding, LSTM
from draw import draw_history
from metrics import recall, precision, f1
from keras.callbacks import ModelCheckpoint, EarlyStopping, CSVLogger
import time
from utils import mkdir, best_model_file... | null | models/blstmModel.py | blstmModel.py | py | 4,831 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.strftime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.mkdir",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "keras.callbacks.ModelCheckpo... |
400908001 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# from: https://github.com/fartashf/vsepp/blob/master/model.py
import torch
import torch.nn as nn
import torch.nn.init
fro... | null | loss.py | loss.py | py | 2,216 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "torch.eye",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
... |
523386248 | import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.gen
import time
import json
import logging
import struct
from tornado.escape import json_encode
import sys
import socket
import os
import datetime
from newInstall import log_monitor
from newInstall import global_settings
from configparser imp... | null | server/server.py | server.py | py | 11,856 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "newInstall.global_settings.init",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "newInstall.global_settings",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "newInstall.log_monitor.get_rasps_from_csv",
"line_number": 22,
"usage_type": "... |
210452434 | # -*- coding: utf-8 -*-
# __author__ = 'qinjincheng'
import datetime
import os
import time
from multiprocessing import Process
def decorator(func):
def wrapper(*args, **kwargs):
begin_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print('{} INFO: begin of the function ({})'.format(be... | null | process/demo.py | demo.py | py | 1,911 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.now",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "da... |
104353664 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse
from album.models import Category, Photo
from django.views.generic import ListView, DetailView
# Create your views here.
def category(request):
category_list = Category.objects.a... | null | album/views.py | views.py | py | 763 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "album.models.Category.objects.all",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "album.models.Category.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "album.models.Category",
"line_number": 13,
"usage_type": "name"
},... |
581366725 | import json
from meteostat import Stations, Hourly
from datetime import datetime, timedelta
def create_datetime_ID(dt):
out = ""
out += str(dt.year) + str(dt.month).zfill(2) + str(dt.day).zfill(2)
out += str(dt.hour).zfill(2) + str(dt.minute).zfill(2)
return out
def interpolate_minutes(row1, row2):... | null | public/scripts/fetch_temps.py | fetch_temps.py | py | 1,605 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.timedelta",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.date... |
378317665 | # -*- coding:utf-8 -*-
from pyramid.view import view_config
from ...services.twitter import TwitterService
from ...models.user import User
from ...models import DBSession
from . import BadRequest, AuthorizeFailure
from . import user_authorize
@view_config(route_name='api_user_show', renderer='json')
def show(request)... | null | wanto/views/api/user.py | user.py | py | 4,409 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "models.DBSession.query",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "models.user.User",
"line_number": 15,
"usage_type": "argument"
},
{
"api_name": "models.DBSession",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pyramid.... |
25862733 | from openpyxl import Workbook
from openpyxl import load_workbook
from openpyxl.styles import Alignment, Font
from openpyxl.styles import Border, colors, PatternFill, Side
import sys, time
def ExportExcelFilePath(Data, TargetPath):
print("=== Export Excel =================================")
inputDate = Data[0]
... | null | Model/Export_Write.py | Export_Write.py | py | 27,852 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.strftime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "openpyxl.Workbook",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_... |
367112208 | from future.utils import iteritems
import pytest
import unittest
import numpy as np
import pyqg
from pyqg import diagnostic_tools as diag
def test_describe_diagnostics():
""" Test whether describe_diagnostics runs without error """
m = pyqg.QGModel(1)
m.describe_diagnostics()
def test_paramspec_diagnosti... | null | pyqg/tests/test_diagnostics.py | test_diagnostics.py | py | 3,733 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyqg.QGModel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyqg.QGModel",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
16328518 | import pyowm
import random
import math
owm = pyowm.OWM('33090165cfd01a96ecf247cc9b3b86d7')
print('*' * 100)
print('Привіт! Вибери місто, погоду у якому бажаєш дізнатись!')
city = str(input())
observation = owm.weather_at_place(city)
w = observation.get_weather()
print(f"""Погода станом на {w.get_reference_time(timefo... | null | clsswrk_190819.py | clsswrk_190819.py | py | 4,142 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyowm.OWM",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "math.pow",
"line_number": 46... |
544695115 | from .incremental_id_list import *
from .item_list_element import *
from datetime import datetime, date
from ..str_vars import *
class ItemList(IncrementalIDList):
def __init__(self, item_type_list, priority_list, contact_info_book):
super().__init__()
self.set_root()
self.item_type_list =... | null | want_to_list/model/item_list.py | item_list.py | py | 3,796 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "datetime.datetime.today",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "dat... |
198766763 | from collections import defaultdict
gg = {1: [2, 3, 5], 2: [4, 5], 3: [6], 4: [3, 8],
5: [6, 7], 6: [7], 7: [4, 9], 8: [7, 9], 9: []}
c = {(1, 2): 8, (1, 3): 9, (1, 5): 6, (2, 4): 5, (2, 5): 6, (3, 6): 6, (4, 3): 5, (4, 8): 4, (5, 6): 3, (5, 7): 5, (6, 7): 4, (7, 4): 3, (7, 9): 9, (8, 7): 5, (8, 9): 6}
F_max = ... | null | i_an/ii_sem/msp/ll/ll5/code/old/hope.py | hope.py | py | 2,586 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.defaultdict",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 13,
"usage_type": "call"
},
{
"api_name"... |
32620495 | from flask import Flask
from flask import request
from flask import render_template
app = Flask(__name__)
@app.route('/')
def my_form():
return render_template("form.html") # this should be the name of your html file
@app.route('/', methods=['POST'])
def my_form_post():
text1 = request.form['first']
text... | null | form/getData.py | getData.py | py | 409 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
566990264 | """
Compares optimizers.
"""
from __future__ import print_function, division
import warnings
warnings.filterwarnings('ignore')
# import comet_ml
import os
import sys
import pathlib
import itertools
import gzip
import argparse
import datetime
from time import time
from pprint import pprint
import sklearn
import num... | null | src/train/top6_cmpr_optimizers.py | top6_cmpr_optimizers.py | py | 9,997 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.use",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "sys.path.append",
... |
582966249 | # !/usr/bin/env python3
import cv2, sys, math
import numpy as np
"""
This program finds out when the defender will intercept the ball.
Run this program via command line with the command python main.py <no of images> left-%3.3d.png right-%3.3d.png
Example output:
frame x_ball y_ball z_ball ... | null | OpenCV/main.py | main.py | py | 11,327 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.minEnclosingCircle",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "cv2.findContours",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_EXTERNAL",... |
260169655 | # -*- coding:utf-8 -*-
'''
解码库,完成平台数据的解码
创建者:fujunwei
创建时间:2011-3-16
'''
from com.zctt.dmp.core import Field, FieldType
import struct, time, logging
from xml.dom import minidom
from xml.etree import cElementTree
# 数据字典定义
class DataDictionary:
def __init__(self):
self.fields = []
def getFieldIDByName... | null | service/com/zctt/iaap/paf/endecode/decode.py | decode.py | py | 23,432 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.etree.cElementTree.fromstring",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "xml.etree.cElementTree",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "com.zctt.dmp.core.Field",
"line_number": 48,
"usage_type": "call"
},
{
"... |
32073753 | import keras
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras import backend as K
# th oznacava da ce konvoluciono jezgro biti oblika (depth, input_depth, ro... | null | train.py | train.py | py | 2,503 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.backend.set_image_dim_ordering",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "keras.backend.image_data_format",
"line_number": 21,
"usage_type": "call"
},
{
"... |
277605793 | import RPi.GPIO as GPIO
from gpiozero import LED
from time import sleep
import sys
ledg = LED(16)
ledr = LED(20)
ledb = LED(21)
# GPIO.setmode(GPIO.BCM)
# GPIO.setwarnings(False)
# pin = 17 # pin 11 on the RP board
# GPIO.setup(pin, GPIO.OUT)
# state = int(sys.argv[1])
# GPIO.output(pin, (GPIO.LOW if state == 0 else ... | null | demo/Sensor/LED.py | LED.py | py | 487 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gpiozero.LED",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gpiozero.LED",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "gpiozero.LED",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 2... |
617967989 | import json
from pyproj import Proj, transform
from bokeh.core.properties import Enum
from bokeh.models import GeoJSONDataSource, HoverTool, ColorBar, BasicTicker, BasicTickFormatter
from bokeh.plotting import figure
from bokeh.tile_providers import STAMEN_TERRAIN
def bokeh_choropleth(data_df, geojson, key_on, data, ... | null | Uber Analytics/bokeh_choropleth.py | bokeh_choropleth.py | py | 2,190 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pyproj.Proj",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pyproj.Proj",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyproj.transform",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pyproj.transform",
"line... |
649120209 | __author__ = 'chriswhsu'
#!/usr/bin/env python
import logging
from time import sleep
from datetime import datetime
recreate = True
log = logging.getLogger()
log.setLevel('DEBUG')
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(name)s: %(message)s"))
log.addHandl... | null | crest/sense/misc/ddata.py | ddata.py | py | 1,486 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cassandra.cl... |
368718864 | import networkx as nx
import itertools
import community as community_louvain
class Polarization:
def __init__(self, edgelist_file, community_file = None):
try:
#Take in edgelist to create networkx graph object
self.G = nx.read_edgelist(edgelist_file)
except:
print("Edgelist file either not provided or n... | null | polarization.py | polarization.py | py | 8,594 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "networkx.read_edgelist",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "community.best_partition",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 68,
"usage_type": "call"
}
] |
235668759 | """Methods to deal with large populations."""
import numpy as np
import os
import uuid
from frbpoppy.log import pprint, progressbar
from frbpoppy.survey_pop import SurveyPopulation
from frbpoppy.population import unpickle
from frbpoppy.paths import paths
class LargePopulation:
"""Method to deal with a large popul... | null | frbpoppy/large_pop.py | large_pop.py | py | 3,480 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "frbpoppy.log.pprint",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "frbpoppy.log.progressbar",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "frbpoppy.surv... |
213770967 | import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
from lanedetection_depends import LaneDetection
ld = LaneDetection()
images_format = './test_images/straight_lines'
output_format = './output_images/straight_warped'
for idx in range(1, 3):
img = cv2.imread(images_format + str(idx) + '.jpg... | null | test_perspective.py | test_perspective.py | py | 1,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "lanedetection_depends.LaneDetection",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.int32... |
523714401 | #!/usr/env/dev python
# -*- coding: utf-8 -*-
"""IS 211 FINAL PROJECT"""
import urllib2
from flask import (Flask, render_template, request, redirect, session, g,
url_for, abort, flash)
from contextlib import closing
import json
import sqlite3
DATABASE = '/tmp/books.db'
DEBUG = True
SECRET_KEY = '9... | null | app.py | app.py | py | 4,445 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "contextlib.closing",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask.g.db",
"line... |
452981763 | import sys
import os
import json
import pathlib
import re
def update_caption(image_filename, proj_string, doc_directory,
doc_extension='rst'):
"""
Update the figure caption with a proj-string
This function assumes that within the "doc_directory" there is a file with
the same basena... | null | docs/plot/figure_captions.py | figure_captions.py | py | 2,529 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.splitext",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
287851987 | #! /usr/bin/python3
import bitcoin.rpc
from bitcoin.core import *
from bitcoin.core.script import *
from bitcoin.wallet import *
from bitcoin.core.key import CECKey
import hashlib
PORT = 18444
bitcoin.SelectParams('regtest')
proxy = bitcoin.rpc.Proxy()
h = hashlib.sha256(b'correct horse battery staple').digest()
seck... | null | Test/spend_unconfirmd.py | spend_unconfirmd.py | py | 1,290 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "bitcoin.rpc.SelectParams",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "bitcoin.rpc",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "bitcoin.rpc.rpc.Proxy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bitcoin.rp... |
133776009 | """aaco URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/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')
Class-based vi... | null | aaco/urls.py | urls.py | py | 1,612 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 23,
"usage_type": "call"
},
{
"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": "djan... |
137741051 | from django.shortcuts import render,redirect,reverse
from django.http import HttpResponseRedirect
from django.contrib import messages
from app.forms.company_form import (CompanyForm, ProductForm,
BranchForm,PermitForm,EmployeeForm,SuplierForm,GasForm
)
from app.selectors.company_selector import (get_companys,
get_com... | null | app/views/company_views.py | company_views.py | py | 6,046 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.forms.company_form.CompanyForm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "app.selectors.company_selector.get_companys",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "app.forms.company_form.CompanyForm",
"line_number": 21,
"u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.