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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
193731288 | import re
import scrapy
from scrapy.loader import ItemLoader
from ..items import RbvItem
from itemloaders.processors import TakeFirst
pattern = r'(\xa0)?'
class RbvSpider(scrapy.Spider):
name = 'rbc'
start_urls = ['http://www.rbc.com/newsroom/news/index.html']
def parse(self, response):
articles = response.xpat... | null | rbc/spiders/spider.py | spider.py | py | 1,184 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrapy.Spider",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scrapy.loader.ItemLoader",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "items.RbvItem",
... |
211462365 | '''
keras 初始版本
不使用词嵌入方式处理输入的文本信息
lb 0.2280
'''
import time
notebookstart = time.time()
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE... | null | huiqin/keras_cls_novec_v4.py | keras_cls_novec_v4.py | py | 17,983 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_numbe... |
579390557 | # -*- coding: utf-8 -*-
from fqi.fqi import FQI
from regressors.mlp import MLP
from preprocessors.mountainCarPreprocessor import MountainCarPreprocessor
from keras.optimizers import SGD, Adadelta, RMSprop
import numpy as np
nActions = 2
#opt = SGD(lr=.05, decay=0, momentum=.9)
opt = Adadelta()
#opt = RMSprop()
mlp =... | null | Test/mountainCar.py | mountainCar.py | py | 704 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.optimizers.Adadelta",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "regressors.mlp.MLP",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "fqi.fqi",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "fqi.fqi.FQI",
... |
465952902 | from tibanna_ffcommon.wfr import (
InputFilesForWFRMeta,
InputFileForWFRMeta,
create_ordinal,
aslist
)
import pytest
@pytest.fixture
def fake_wfrmeta_input_dict():
return {'workflow_argument_name': 'somearg',
'value': 'someuuid',
'ordinal': 1,
'dimension': '0',
... | null | tests/tibanna/ffcommon/test_wfr.py | test_wfr.py | py | 3,773 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pytest.fixture",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pytest.fixture",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "tibanna_ffcommon.wfr.create_ordinal",
"line_number": 28,
"usage_type": "call"
},
{
"api_n... |
646973582 | import numpy as np
import dill as dpickle
import tensorflow as tf
from tensorflow.keras.utils import multi_gpu_model
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, GRU, Dense, Embedding, Conv1D, Bidirectional, BatchNormalization, Dot, Flatten, Concatenate
from tensorflow.keras.opt... | null | argo/src/train.py | train.py | py | 2,926 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "dill.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 30,
... |
426259395 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import os
from collections import namedtuple
from urllib import urlencode
from django.conf import settings
from funkload.FunkLoadTestCase import FunkLoadTestCase
from funkload.utils import Data
CONF_TMPL =... | null | django_funkload/tests.py | tests.py | py | 2,126 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "collections.namedtuple",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "funkload.FunkLoadTestCase.FunkLoadTestCase",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "django.conf.settings",
"line_number": 54,
"usage_type": "argument"
},... |
389247210 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 15:25:55 2017
@author: ljb
"""
import numpy as np
import scipy as sp
import pandas as pd
import re
from scipy import optimize
from sympy import gcd_list
from scipy import sparse as sprs
import copy
from plasmistry.reactions import CoefReactions
import warnings
warning... | null | plasmistry/pathways/pathways.py | pathways.py | py | 22,063 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.lexsort",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.any",
... |
428258874 | import torch
from torchtext import data
from torchtext.vocab import Vectors
def get_iter(vector_path: str = None,
train_path: str = None,
dev_path: str = None,
test_path: str = None,
file_format: str = 'csv',
batch_size: int = 32,
torch_dev... | null | data_helper.py | data_helper.py | py | 3,045 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch._C",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torchtext.data.Field",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torchtext.data",
... |
455893348 | import sh
import time
from concurrent.futures import ThreadPoolExecutor
executor = ThreadPoolExecutor(1)
lan_address: str = ''
lan_play = None
update_timestamp = int(time.time())
def start_lan_play(ip: str):
print(ip)
stop_lan_play()
executor.submit(_start_lan_play, ip)
def stop_lan_play():
global... | null | services/service_lan.py | service_lan.py | py | 1,179 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sh.Command",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
460553157 | import re
import datetime
import json
from chatbot.static import QA_FILE, QA_KEYWORD, MEDICINE_NAME
from wit import Wit
import random
import traceback
access_token = "IMR2QK2LRAF4KEIPWGK72UOYALF366FG"
client = Wit(access_token)
def wit_mess(input):
try:
return client.message(input)
except:
re... | null | chatbot/utils.py | utils.py | py | 6,746 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "wit.Wit",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "chatbot.static.QA_KEYWORD",
"line_num... |
291248451 | import requests
base_api_url = "https://app.api-messenger.com/webhook?token=8NIK59gSilfe201bb4ae0cdd2f8ce45e7d3b87c602"
auth_token = "8NIK59gSilfe201bb4ae0cdd2f8ce45e7d3b87c602"
def send_msg():
json = [
{
"chatId": "77015988869@c.us",
"message": "тест1"
},
{
"chatId": "77015988869@c.us",
"message... | null | testhool.py | testhool.py | py | 414 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
}
] |
553151520 | from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.conf.urls import url
app_name='user'
urlpatterns=[
path('account/',views.AccountHomeView.as_view(),name='account_home'),
path('details/',views.AccountUpdateView.as_view(),name='user-update'),
... | null | ecom1-master/user/urls.py | urls.py | py | 710 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
259027122 | import json
import csv
import urllib.request
import ssl
import re
import csv
import io
import collections
import pymysql
import pymysql.cursors
import redis
import os
import operator
import sys
from hashlib import blake2b
from datetime import datetime
from datetime import timedelta
import time
pymysql.install_as_MySQL... | null | data/louisvillekygov-to-awscivicdata.py | louisvillekygov-to-awscivicdata.py | py | 8,807 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pymysql.install_as_MySQLdb",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "redis.StrictRedis",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "redis.St... |
76915198 | from flask import Flask,request,jsonify
from pymongo import MongoClient
from mongoengine_jsonencoder import MongoEngineJSONEncoder
app = Flask(__name__) #플라스크 객체 생성
app.json_encoder = MongoEngineJSONEncoder
app.config['JSON_AS_ASCII'] = False #인코딩
#client = MongoClient("mongodb://14.32.18.97:27017/")
client = MongoC... | null | restapi/__init__.py | __init__.py | py | 1,533 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mongoengine_jsonencoder.MongoEngineJSONEncoder",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_... |
391386386 | import os
import sys
import json
import argparse
import re
sys.path.append('..')
import core.json_processor as json_processor
redundant_mod_keys = ["_MOD_uos_camera", "_MOD_uos_chassis_ctrl", \
"_MOD_uos_compass", "_MOD_uos_cv_framework", \
"_MOD_uos_gps", "_MOD_uos_hawkeye"... | null | junction_dbn_eval/junction_dbn_eval_prepare_one_case.py | junction_dbn_eval_prepare_one_case.py | py | 4,789 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "core.json_processor.json_processor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "core.j... |
211070448 | from bs4 import BeautifulSoup
import requests
import logging
# 한건의 data 추출
def find_impaired_ratio(stc_id, base_ratio = 45):
# 로거
logger = logging.getLogger(__name__)
try:
# 데이터 탐색
url = "https://comp.fnguide.com/SVO2/ASP/SVD_main.asp?pGB=1&gicode=A"+str(stc_id)\
+"&cID=&Men... | null | stockToKakao/p11_get_filltered_big_stock_info/crawler/crawlImpairedRatio.py | crawlImpairedRatio.py | py | 2,264 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 16,
"usage_type": "call"
}
] |
497408354 | """
Stochastic Shortest Path Extension
Using point estimates
"""
from collections import (namedtuple, defaultdict)
import numpy as np
class StaticModel():
"""
Base class for model
"""
def __init__(self, state_names, x_names, params):
"""
Initializes the model
:param state_n... | null | Chap5_Sto_Short_Path_Static/function/StaticModelAdaptive.py | StaticModelAdaptive.py | py | 8,096 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.random.RandomState",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "collections.namedtuple",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "col... |
50474139 | from flask import render_template, request
from people.models import Xiaoqu, People_jh
from people.__init__ import people
@people.route('/')
def index():
return render_template('people/people.html')
@people.route('/pt/', methods=["POST", "GET"])
def pt():
province = request.args['province']
city = requ... | null | people/view.py | view.py | py | 2,821 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.render_template",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "people.__init__.people.route",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "people.__init__.people",
"line_number": 6,
"usage_type": "name"
},
{
"api_name":... |
558282172 | import pandas as pd
import json
from flask import Flask,request,jsonify, Blueprint,redirect
app = Flask(__name__)
data_get_app = Blueprint('data_get_app', __name__)
@data_get_app.route("/get",methods=['GET'])
def ff():
df = pd.read_csv("dataframe_post.csv")
new_dict=df.to_dict("index")
abc=list(new_dict... | null | New folder/API_Files/get_data.py | get_data.py | py | 357 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_numb... |
573668548 | #!/usr/bin/python
import xml.sax
import xml.sax.handler
import geo
home=geo.xyz(51.059146, 13.767000)
shortType={
u'Earthcache':u'E',
u'Virtual Cache':u'V',
u'Cache In Trash Out Event':u'CITO',
u'Unknown Cache':u'?',
u'Multi-cache':u'M',
u'Event ... | null | readGpx.py | readGpx.py | py | 5,795 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "geo.xyz",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "geo.xyz",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "geo.distance",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "geo.great_circle_angle",
"line_number... |
86846305 | from typing import Any
import proto
from google.ads.googleads.v12.enums.types.month_of_year import MonthOfYearEnum
class DateRange(proto.Message):
start_date: str
end_date: str
def __init__(
self,
mapping: Any | None = ...,
*,
ignore_unknown_fields: bool = ...,
sta... | null | google-stubs/ads/googleads/v12/common/types/dates.pyi | dates.pyi | pyi | 966 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "proto.Message",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "proto.Message",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "google.ads.googleads.... |
162782490 | import pytest
import mosaic.process.adept2State as a2s
from mosaic.tests.algorithmCommon import Base2StateTest, DatBlockTest
@pytest.fixture
def Base2StateTestObject(request):
basename='mosaic/tests/testdata/test'+str(request.param)
b=Base2StateTest()
b.datFile=basename+'.csv'
b.prmFile=basename+'.prm'
return b... | null | mosaic/tests/test_adept2state.py | test_adept2state.py | py | 1,257 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mosaic.tests.algorithmCommon.Base2StateTest",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mosaic.tests.algorithmCommon.Base2StateTest",
"line_number": 18,
"usage_typ... |
346164425 | def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
warnings.filterwarnings("ignore")
warnings.filterwarnings("ignore", category=DeprecationWarning)
import numpy as np
import pandas as pd
from sklearn.preprocessing import Imputer
from sklearn.model_selection import KFold
from scip... | null | untitled2(2)/untitled2/basic.try.py | basic.try.py | py | 14,906 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "warnings.warn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy... |
397409728 | from django.http import Http404
from django.shortcuts import render, get_object_or_404
from .models import Product
from .forms import ProductAddForm, ProductModelForm
# Create your views here.
def create_view(request):
#FORM LONG WAY
form = ProductModelForm(request.POST or None)
if form.is_valid():
instance = f... | null | src/products/views_old.py | views_old.py | py | 2,637 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "forms.ProductModelForm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 41,
"usage_type": "call"
},
{
... |
576794701 | # import libraries
import sys
import joblib
import pandas as pd
import re
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sk... | null | train_classifier.py | train_classifier.py | py | 5,239 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "nltk.download",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_table",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "re.sub",
... |
190682332 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_audit_pkg(host):
pkg = host.package('audit')
assert pkg.is_installed
def test_audit_service(host):
vrt = host.ansible("se... | null | molecule/default/tests/test_default.py | test_default.py | py | 495 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "testinfra.utils.ansible_runner.utils.ansible_runner.AnsibleRunner",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "testinfra.utils.ansible_runner.utils",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "testinfra.utils.ansible_runner",
"l... |
493320309 | #!/usr/bin/env python
"""Basic test case for rabbitmq health.
Client A posts a job to Queue and Client B gets the content from.
Usage:
$ python testrabbitmq.py
Requirements:
* python 2.7
* pika
* unitest
"""
import unittest
from Queue import Queue
from thread import start_new_thread
import pika
im... | null | scripts/testrabbitmq.py | testrabbitmq.py | py | 2,893 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unittest.TestCase",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "Queue.Queue",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "pika.BlockingConnection... |
376202536 | from typing import Tuple, List
from raidensim.network.node import Node
from numpy import array
Fullness = float
Reason = str
IntRange = Tuple[int, int]
FloatRange = Tuple[float, float]
Path = List[Node]
Coord = array
DiskCoord = array
PolarCoord = array
| null | raidensim/types.py | types.py | py | 256 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.Tuple",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "raidensim.network.node.Node",
... |
625607123 | import numpy as np
import numpy.linalg as la
import pickle
import torch
import torch.utils.data as td
import torch.nn as nn
import torch.nn.functional as nnF
import torch.optim as optim
import sys
import argparse
sys.path.append('../lib')
sys.path.append('.')
import helpers
from model import *
parser = argparse.Argu... | null | conv-cnn/train.py | train.py | py | 4,338 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
545110501 | import os
from uuid import UUID
import json
from django.test import TestCase
from django.db.models import Prefetch, Q
from runner.operator.alignment_pair_operator.v1_0_0.bin.retrieve_samples_by_query import build_dmp_query
from runner.operator.alignment_pair_operator.v1_0_0.bin.retrieve_samples_by_query import get_dmp_... | null | runner/tests/operator/alignment_pair_operator/v1_0_0/test_retrieve_samples_by_query.py | test_retrieve_samples_by_query.py | py | 19,959 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "runner.operator.alignment_pair_operator.v1_0_0.bin.retrieve_samples_by_query.build_dmp_query",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_... |
285703081 | from django.core.management.base import BaseCommand
from django.db.models import Sum
from ...models import Year, Transaction, Entry, Journal, Account
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('old_year_pk')
parser.add_argument('new_year_pk')
def handle(s... | null | accounting/management/commands/closing.py | closing.py | py | 2,137 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.Year.objects.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Year.objects",
"line_number": 12,
"usage_type": "attribute"
},
... |
204568185 | import numpy as np
import unyt as u
import numpy.testing as npt
## Reoccuring constants
c = u.c # speed of light from unyt
m_muon = 105.7 * u.MeV / c**2
m_pion = 139.6 * u.MeV / c**2
m_electron = 0.5110 * u.MeV / c**2
m_neutrino = 0 * u.MeV / c**2 # approximately 0
m_proton = 938.3 * u.MeV / c**2
### Funct... | null | cosmic.py | cosmic.py | py | 18,852 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "unyt.c",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "unyt.MeV",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "unyt.MeV",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "unyt.MeV",
"line_number": 10... |
40455575 | import json
startTime = ""
endTime = ""
controller = 0
for files in range(30):
file = open("NewResults" + str(files+1) + ".data")
for line in file:
if line != "\n":
j = json.loads(line)
if controller == 0:
startTime = j['metrics'][0]['startTime']
helper = startTime.split(" ")
hour = helper[1].sp... | null | results/camera_ready/results_HFU_LV/test.py | test.py | py | 1,087 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
}
] |
446017180 | """
Entry points that are used to query the data in the APIs.
"""
import logging
from timesync.harvest import connection as harvest
import tabulate
LOGGER = logging.getLogger(__name__)
def time_entries(date, project_id):
"""
Generator that iterates through all of the time entries of a specified day and pro... | null | timesync/harvest/entries.py | entries.py | py | 3,858 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "timesync.harvest.connection.get_time_entries",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "timesync.harvest.connection",
"line_number": 21,
"usage_type": "name"
},... |
511195964 | from datetime import datetime
from pyppeteer.page import PageError, Page
from configurations.settings import DARK_PURPLE, ENDE, INBOX, LIGHT_BLUE
from pyppeteer.errors import TimeoutError
from logging import Logger
from typing import Dict
async def get_info(page,country_id,origin,origin_id, destination,destination_id... | null | scripts/turkey.py | turkey.py | py | 5,847 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.Logger",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.fromisoformat",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pyppe... |
641346999 | from django.urls import reverse
from django.contrib.auth.models import User
from django.test import TestCase
import datetime
from .models import Investimento, TipoInvestimento, Moeda, Meta, Despesa, Fundo, TipoDespesa, Fundo
from django.test import TestCase
from .views import home
from .views import login
from .views ... | null | mywallet/core/tests/tests.py | tests.py | py | 4,369 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.TestCase",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.urls.reverse",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "django.u... |
427474256 | import datetime
from unittest.mock import MagicMock, patch
import pytz
from freezegun import freeze_time
from multi_tenancy.models import OrganizationBilling, Plan
from multi_tenancy.tasks import compute_daily_usage_for_organizations
from multi_tenancy.tests.base import CloudBaseTest
class TestTasks(CloudBaseTest):
... | null | multi_tenancy/tests/test_tasks.py | test_tasks.py | py | 6,339 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "multi_tenancy.tests.base.CloudBaseTest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "multi_tenancy.models.Plan.objects.create",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "multi_tenancy.models.Plan.objects",
"line_number": 17,
"u... |
538733017 | import os
import time
import json
import click
import send2trash
import pandas as pd
from scrape_linkedin import ProfileScraper
LI_AT = ""
def _collect_data(profile_link):
try:
with ProfileScraper(cookie=LI_AT) as scraper:
profile = scraper.scrape(user=profile_link)
return profile.to_... | null | linkedin/mk2/CollectData.py | CollectData.py | py | 2,177 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "scrape_linkedin.ProfileScraper",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",... |
240281297 | from kivy.lang import Builder
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivymd.app import MDApp
from kivymd.toast import toast
from kivymd.uix.useranimationcard import MDUserAnimationCard
from kivymd.uix.button import MDIconButton
from kivymd.uix.list import ILeftBodyTouch
# Your... | null | Python/Projects/kivy practice.py | kivy practice.py | py | 2,274 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "kivy.lang.Builder.load_string",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "kivy.lang.Builder",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "kivymd.uix.list.ILeftBodyTouch",
"line_number": 55,
"usage_type": "name"
},
{
"ap... |
138576544 | # -*- coding: utf-8 -*-
"""
策略模板基类
"""
from copy import deepcopy
from abc import abstractmethod
from time import sleep, time
from pandas import DataFrame, to_datetime, isna, merge, read_pickle, isnull
from numpy import cov, var, std, nan, hstack
from math import sqrt
from pyecharts import Line, Page
from queue import ... | null | strategy/strategy_base_backtest_backup.py | strategy_base_backtest_backup.py | py | 66,159 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "data_center.get_data.GetSqliteData",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "core.context.Context",
"line_number": 72,
"usage_type": "call"
},
{
"api_name... |
403326810 | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pyemu
nsamples = 100
hk_values = np.linspace(0.1,4.0,nsamples)
fx_values = np.linspace(.1,2.5,nsamples)
def write_input_csv():
c = 0
with open("grid.csv",'w') as f:
f.write("run_id,hk1,cal_flux\n")
for v1 in hk_values:
fo... | null | models/10par_xsec/model/response_surface.py | response_surface.py | py | 1,492 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_num... |
475283420 | """Tests for `neo update` subcommand."""
import pytest
import os
import time
from neo.libs import vm as vm_lib
from neo.libs import orchestration as orch
from neo.clis import Update
class TestUpdate:
@pytest.mark.run(order=2)
def test_do_update(self):
cwd = os.getcwd()
# wait until last vm su... | null | tests/test_update.py | test_update.py | py | 1,510 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "neo.libs.vm.get_list",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "neo.libs.vm",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_num... |
324567905 | """
Write a program that makes a DELETE request to remove the user your create in a previous example.
Again, make a GET request to confirm that information has been deleted.
"""
import requests
url = 'http://demo.codingnomads.co:8080/tasks_api/users'
url_delete = url + '/285'
response1 = requests.delete(url_delete)... | null | python_apis_databases/apis/Exercise_05.py | Exercise_05.py | py | 374 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "requests.delete",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
}
] |
245655619 | import requests
import json
from apps.NBL.tools import *
import traceback
from apps.send_error_msg import dingding_alter
from common.libs.log import LogMgr
logger = LogMgr.get('nbl_basketball_venue')
def venue_info():
headers = {
'user_agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/... | null | apps/NBL/nbl_venue.py | nbl_venue.py | py | 1,580 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "common.libs.log.LogMgr.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "common.libs.log.LogMgr",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "json.loa... |
639662915 | import os
import numpy as np
import cv2
import torch
from clean_vald_annotations_file import clean_labels
def gen_annotations(f_path):
"""
Input:
'f_path' : location of txt file that contains segment wise annotations for test dataset
Output:
'test_dset_list' : a list where
each entry of list is... | null | code/gen_test_annotations.py | gen_test_annotations.py | py | 6,627 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.abspath",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_numbe... |
461135619 | # -*- coding: utf-8 -*-
"""User views."""
from flask import Blueprint, render_template, jsonify, request
from flask_login import login_required, current_user
from SUIBE_DID_Data_Manager.extensions import csrf_protect
from SUIBE_DID_Data_Manager.weidentity.localweid import create_watting_weid, create_random_weid, ecdsa_... | null | SUIBE_DID_Data_Manager/blueprints/weid/weid.py | weid.py | py | 1,726 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Blueprint",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "SUIBE_DID_Data_M... |
497104631 | from environs import Env
import os.path
import redis
env = Env()
env.read_env()
ENV = env.str("FLASK_ENV")
DEBUG = env.str("DEBUG")
SQLALCHEMY_DATABASE_URI = env.str("SQLALCHEMY_DATABASE_URI")
SECRET_KEY = env.str("SECRET_KEY")
SQLALCHEMY_TRACK_MODIFICATIONS = False
RECAPTCHA_USE_SSL = env.str("RECAPTCHA_USE_SSL")
... | null | app/settings.py | settings.py | py | 946 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "environs.Env",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.path.abspath",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"lin... |
438235392 | from constants import *
import sympy as sym
from math import radians, degrees
class Symbol(sym.Symbol):
""" Класс-наследник для реализации работы с углами """
def __init__(self, name, is_angle=False):
super(Symbol, self).__init__()
self.name = name
self.is_angle = is_angle
se... | null | formulas.py | formulas.py | py | 8,237 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sympy.Symbol",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "math.radians",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "math.degrees",
"l... |
399203474 | # coding=utf-8
from django.conf import settings
from msg.models import Msg as MsgModel
class Msg(object):
def __init__(self, engine):
self.engine = engine
self.inbox = None
self.outbox = None
self.unread_messages = MsgModel.objects.get_unread_count(self.engine.user.user,
... | null | common/modules/msg.py | msg.py | py | 1,347 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "msg.models.Msg.objects.get_unread_count",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "msg.models.Msg.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "msg.models.Msg",
"line_number": 13,
"usage_type": "name"
},
{
... |
72765824 | '''
Implementation of Deepfix by Kruthiventi et al.
@author: Xiao Shanghua
Bug fixes, modified to support pre-trained model intitialization from VGG weights, removing bias for consistency
with experiment setup, etc. (See deepfix branch for original Shanghua's implementation). Hamed R. Tavakoli
'''
import torch
impor... | null | saliency/fastsal/torch/models/deepfix.py | deepfix.py | py | 3,658 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
162857119 | import logging
from copy import copy
from pathlib import Path
from typing import Any, Dict, List, Mapping, Optional, cast
from sdmx.model import Annotation, Code
log = logging.getLogger(__name__)
try:
import message_data
except ImportError:
log.warning("message_data is not installed")
MESSAGE_DATA_PATH: ... | null | message_ix_models/util/__init__.py | __init__.py | py | 5,470 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.getLogger",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"lin... |
90160447 | import discord
from discord.ext import commands
from cogs.database import Database
class Tags(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.db = Database(self.bot)
@commands.group(invoke_without_command=True)
async def tag(self,ctx,name=None):
if not name:
... | null | cogs/tags.py | tags.py | py | 2,547 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "cogs.database.Database",
"line_number": 8,
"usage_type": "call"
},
{
"api_name":... |
485772694 | # # Importing Libraries
# import serial
# import time
# arduino = serial.Serial(port='/dev/ttyACM0', baudrate=9600, timeout=.1)
# def write_read(x):
# arduino.write(bytes(x, 'utf-8'))
# time.sleep(0.05)
# data = arduino.readline()
# return data
# while True:
# num = input("Enter a number: ")
# ... | null | komunikasi.py | komunikasi.py | py | 1,416 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "serial.Serial",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "struct.pack",
"line_number":... |
273468006 | import os
import glob
import re
import csv
import argparse
import shutil
import sys
import tensorflow as tf
_CSV_COLUMNS = ['line', 'dist_from_top', 'contains_punctuation', 'contains_author_or_by', 'labels']
_CSV_COLUMN_DEFAULTS = [[''], [0], [''], [''], ['']]
parser = argparse.ArgumentParser()
parser.add_argument(
... | null | findAuthors_classifier.py | findAuthors_classifier.py | py | 4,781 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column.numeric_column",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "tensorflow.feature_column",
"line_number": 47,
"usage_type": "attribute"... |
431595032 | #
# graphs.py
#
# Author(s):
# Matteo Spallanzani <spmatteo@iis.ee.ethz.ch>
#
# Copyright (c) 2020-2021 ETH Zurich.
#
# 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.... | null | editing/graphs/graphs/graphs.py | graphs.py | py | 13,221 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch._C._get_tracing_state",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "torch._C",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "torch._C",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
... |
186926791 | import types
from bs4 import BeautifulSoup
import codecs
import urllib.request
import re
import xml.dom
def create_element(doc,tag,attr):
elementNode=doc.createElement(tag)
textNode=doc.createTextNode(attr)
elementNode.appendChild(textNode)
return elementNode
newsall=" "
dom1=xml.dom.getDOMImpleme... | null | beachbuggy.py | beachbuggy.py | py | 931 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "xml.dom.dom.getDOMImplementation",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "xml.dom.dom",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "xml.dom",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "urllib.requ... |
86009233 | __author__ = 'Marc'
import matplotlib.pyplot as plt
import cv2
#Dieses Skript erlaubt das ansehen der besten Vertreter einer Klasse und
#zeigt in einem Diagramm wie häufig eine Wahrscheinlichkeit ist. X-Achse: Anzahl Galaxien. Y-Achse: Wahrscheinlichkeit
# für Klasse. Die Galaxien werden von links nach rechts absteige... | null | marc test/visualisierer.py | visualisierer.py | py | 1,521 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "operator.itemgetter",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_num... |
129835908 |
def alter_db_table(self, model, old_db_table, new_db_table):
from django.contrib.gis.db.models.fields import GeometryField
for field in model._meta.local_fields:
if isinstance(field, GeometryField):
self.execute((self.sql_remove_geometry_metadata % {
'table': self.quote_nam... | null | Data Set/bug-fixing-2/953629b92cd0225a98fc8d14740fa8866a689e65-<alter_db_table>-fix.py | 953629b92cd0225a98fc8d14740fa8866a689e65-<alter_db_table>-fix.py | py | 1,575 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.contrib.gis.db.models.fields.GeometryField",
"line_number": 6,
"usage_type": "argument"
},
{
"api_name": "django.contrib.gis.db.models.fields.GeometryField",
"line_number": 22,
"usage_type": "argument"
}
] |
100494581 | import pandas as pd
import seaborn as sns
from a0_linear_regreesion import get_x, get_y, batch_gradient_decent
# from a2_线性回归 import get_x, get_y, batch_gradient_decent
from a3_标准化数据 import normalize_feature
sns.set(context="notebook", style="whitegrid", palette="dark")
import matplotlib.pyplot as plt
import numpy as... | null | code/ex1-linear regression/a4_多变量批量梯度下降.py | a4_多变量批量梯度下降.py | py | 1,140 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "seaborn.set",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "a3_标准化数据.normalize_feature",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "a0_linear_regre... |
108493858 | from serial import Serial
from time import sleep
class Modem(Serial):
def write(self, cmd):
# primeste cmd as str, adauga caractere, converteste la bytes si scrie la seriala
cmd = 'AT{}\r'.format(cmd)
cmd = bytes(cmd, 'ascii')
Serial.write(self, cmd)
# cmd = b'AT+CMGL="ALL... | null | modemcmd.py | modemcmd.py | py | 958 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "serial.Serial",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "serial.Serial.write",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "serial.Serial",
"line_number": 9,
"usage_type": "name"
}
] |
123403269 | import numpy as np
import h5py
import matplotlib.pyplot as plt
from keras import layers
from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D
from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAveragePooling2D
from keras.mode... | null | hellopython/tt/lab/dl/CNN_Keras_HappyHouse.py | CNN_Keras_HappyHouse.py | py | 6,055 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "keras.backend.set_image_data_format",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.backend",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "keras.layers.Input",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "... |
21672943 | import sys
from sympy.solvers import solve
from sympy import Symbol
from gmpy2 import isqrt, is_square
# A reimplementation of pablocelayes rsa-wiener-attack for this purpose
# https://github.com/pablocelayes/rsa-wiener-attack/
class WienerAttack(object):
def rational_to_contfrac(self, x, y):
a = x // y... | null | factorize/wiener.py | wiener.py | py | 1,864 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sys.setrecursionlimit",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "gmpy2.is_square",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "gmpy2.isqrt",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sympy.Symbol",
... |
32891757 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import random
import numpy as np
import torch.utils.data
from sklearn.metrics import accuracy_score,precision_score,recall_score,f1_score
def setup_seed(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.see... | null | CIFAR_ten_tasks/main_matrix.py | main_matrix.py | py | 6,932 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "torch.manual_seed",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.cuda.manual_seed_all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.ra... |
362385432 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Carry Chen
# @Email : li.chen@newdegreetech.com, chenliworking@163.com
# @Software: PyCharm
# @Project : cinc2016
# @FileName: main_torch.py
# @Time : 2019/12/31 15:59
# @Description:
"""
"""
from ndtpy.tools import list_all_files, get_fig_title, maximi... | null | main_torch.py | main_torch.py | py | 5,331 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.plotting.register_matplotlib_converters",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 24,
"usage_type": "name... |
532124296 | from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired, Email, ValidationError
from app.models import User
def user_exists(form, field):
# Checking if user exists
email = field.data
user = User.query.filter(User.email == email).first()
if user:
... | null | app/forms/signup_form.py | signup_form.py | py | 1,166 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "app.models.User.query.filter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "app.models.User.query",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.models.User",
"line_number": 10,
"usage_type": "name"
},
{
"api_name"... |
548130131 | import pygame
from Player import Player
from Monster import Monster
class Game:
def __init__(self):
self.all_player = pygame.sprite.Group()
self.score = 0
self.player = Player(self)
self.all_player.add(self.player)
self.all_monster = pygame.sprite.Group()
self.pres... | null | Game.py | Game.py | py | 724 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.sprite.Group",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "Player.Player",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.sprite.Grou... |
537644233 | from pyecharts.charts import Boxplot
import pyecharts.options as opts
import pandas as pd
df = pd.read_csv('city_day.csv')
data = df.loc[df['City'] == 'Delhi', ['Date', 'PM2.5']]
dom1, dom2, dom3 = [], [], []
list1 = []
for date, AQI in zip(data['Date'], data['PM2.5']):
year = date.split('-')[0]
if year in [... | null | chapter8/8.4.2/boxplot_PM2.5.py | boxplot_PM2.5.py | py | 929 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pyecharts.charts.Boxplot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pyecharts.options.TitleOpts",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "p... |
315759400 | from apps.DisplayContent.models import Component, Project, Type, Item
from apps.DisplayContent.resources import ComponentResource, ProjectResource, TypeResource, ItemResource
from apps.UploadHandler.Imports import importNew, upload
import json
def getContentData(j):
data = json.loads(j['d']) #parsing out the JSON... | null | apps/UploadHandler/parseContents.py | parseContents.py | py | 1,444 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "apps.DisplayContent.models.Project.objects.filter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "apps.DisplayContent.models.Project.objects",
"line_number": 15,
"usage_type":... |
570167113 | #!/usr/bin/env python
##
# Massimiliano Patacchiola, Plymouth University 2016
#
# This is an example of head pose estimation with solvePnP.
# It uses the dlib library and openCV
#
import time
import numpy
import cv2
import sys
from deepgaze.haar_cascade import haarCascade
from deepgaze.face_landmark_detection import f... | null | examples/lingyu_headpose-pi.py | lingyu_headpose-pi.py | py | 2,262 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "cv2.cvtColor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.rectangle",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",... |
392275016 | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework import permissions
from rest_framework.response import Response
from user_profile.models import UserProfile
from user_profile.serializers import UserProfileSerializer
from customer_address.models import CustomerAddress
from... | null | customer_address/views.py | views.py | py | 2,143 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "rest_framework.views.APIView",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "rest_framework.permissions.AllowAny",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.permissions",
"line_number": 12,
"usage_type": "name... |
612351037 | from pymongo import MongoClient
from ... import app
from .error import AppError
class Mongo():
def __init__(self, mongo_tag=''):
if not isinstance(mongo_tag, str):
raise AppError('TYPE_ERROR', param='mongo_tag', expect_type='str')
params = {
'host': '',
'port'... | null | movies/models/framework/mongo.py | mongo.py | py | 1,868 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "error.AppError",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "error.AppError",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 48,
"usage_type": "call"
}
] |
226402472 | import numpy as np
import tensorflow as tf
import scipy.ndimage
import yaml
import os
from dl_playground.networks.layers.cnn import ConvNet
from dl_playground.utils.superpixel import rgb_to_normalized_lab
from dl_playground.utils.common import local_mean_tf
class Palette:
"""Convieniet functions for painting tex... | null | exps/texture_gan/paint.py | paint.py | py | 12,314 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.path.dirname",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
161939270 | import sys
import os
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtCore import QSize
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setMin... | null | gui.py | gui.py | py | 1,054 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "name"
}... |
510676758 | import numpy as np
import pyaudio
import scipy.io.wavfile as wav
import threading
from multiprocessing import Process, Queue, Array
import pdb
import warnings
import argparse
import time
import os, sys
import subprocess
import pickle
import time
from demo import emotion_model
from demo_text import emotion_text_model
fr... | null | realtime_final.py | realtime_final.py | py | 3,944 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.fromstring",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.int16",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "numpy.abs",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line... |
326401129 | import asyncio
import io
import json
from typing import Optional, Union
import discord
from redbot.core import Config, checks, commands
from redbot.core.utils import menus
from redbot.core.utils.chat_formatting import box, humanize_list, pagify
from redbot.core.utils.menus import DEFAULT_CONTROLS, close_menu, menu, st... | null | embedutils/embed.py | embed.py | py | 28,537 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "redbot.core.commands.Context",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "redbot.core.commands",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "r... |
588461285 | import numpy as np
import lasagne
import theano
import pickle
import io
import matplotlib.pyplot as plt
import urllib
from scipy.misc import imresize
from lasagne.layers import InputLayer, DenseLayer, DropoutLayer
from lasagne.layers import NonlinearityLayer
from lasagne.nonlinearities import rectify, sigmoid, identit... | null | archive/nucleus_encoder/vgg16/vgg16.py | vgg16.py | py | 3,769 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "theano.tensor.tensor4",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "theano.tensor",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "lasagne.layers.InputLayer",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "la... |
145838219 | from django.shortcuts import render
from django.http import JsonResponse
from .metadata import PROJECT_METADATA as PM
from copy import deepcopy
def start_view(request):
if PM is not None:
context = {"metadata": PM}
else:
context = {}
return render(request, 'webpage/index.html', context)
... | null | webpage/views.py | views.py | py | 1,091 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "metadata.PROJECT_METADATA",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "metadata.PROJECT_METADATA",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 13,
"usage_type": "call"
},
{
"api_nam... |
486704603 | def new_viewer(topo_file):
import numpy as np
import imageio, PIL.Image
import stripy, lavavu
print("Building spherical mesh ", flush=True)
res_lon = 1800
res_lat = 900
mesh = stripy.hybrid_st_meshes.warped_xy_mesh_sphere(res_lon=res_lon, res_lat=res_lat)
print("Readin... | null | viewer.py | viewer.py | py | 1,490 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "stripy.hybrid_st_meshes.warped_xy_mesh_sphere",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "stripy.hybrid_st_meshes",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{... |
265951348 | import os
import mysql
import mysql.connector
import concurrent.futures
import requests, zlib
class ResumeDocstore:
def __init__(self, arg_value):
self.arg_value = arg_value
self.chunk_size = 1000
self.mindate = 0
self.maxdate = 0
self.table_index = 0
self.conf_falc... | null | FalconresumeDocstore/docstore_resume_to_falcon_v3.py | docstore_resume_to_falcon_v3.py | py | 12,155 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "mysql.connector.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "mysql.connector",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "mysql.connector.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "... |
227703825 | ## encoding=utf-8
import numpy as np
from sklearn.metrics import confusion_matrix,recall_score,precision_recall_curve, \
auc,roc_curve,roc_auc_score,classification_report
def read_sentiment(sentiments, columns):
sent_dict = {}
for i,s in enumerate(columns):
sent_dict[s] = i... | null | sentiment_analysis/utils.py | utils.py | py | 1,799 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matri... |
517388410 | from django.db import transaction
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView
from . import forms
from . import models
class HorseList(ListView):
model = models.Horse
class HorseDetail(DetailView):
... | null | apps/horses/views.py | views.py | py | 2,317 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.views.generic.detail.DetailView",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.views.generic.edit.CreateView",
"line_number": 22,
"usage_typ... |
315207050 | "collection of utilities"
from pathlib import Path
import asyncio
def set_timeout(seconds, callback):
async def schedule():
await asyncio.sleep(seconds)
if asyncio.iscoroutinefunction(callback):
await callback()
else:
callback()
asyncio.ensure_future(schedu... | null | lsst_dashboard/utils.py | utils.py | py | 636 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "asyncio.sleep",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "asyncio.iscoroutinefunction",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "asyncio.ensure_future",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pathl... |
626777966 | import os
import multiprocessing as mp
import shutil
import logging
import pandas as pd
from libs.cloner import BASE_CLONE_LOCATION, clone_repository, delete_currently_cloned_repository
from libs.scanner import scan_repo
from libs.metadata_extracter import extract_metadata
from libs.build_log_string_histogram import... | null | log_scanner.py | log_scanner.py | py | 5,072 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"lin... |
625699880 | """edumatch URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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-base... | null | edumatch/urls.py | urls.py | py | 2,125 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.urls.path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "... |
258063994 | import RPi.GPIO as GPIO
import time
import spidev
from lib_nrf24 import NRF24
GPIO.setmode(GPIO.BCM)
pipes = [[0xE0, 0xE0, 0xF1, 0xF1, 0xE0], [0xF1, 0xF1, 0xF0, 0xF0, 0xE0]]
radio = NRF24(GPIO, spidev.SpiDev())
radio.begin(0, 17)
radio.setPayloadSize(32)
radio.setChannel(5)
radio.setDataRate(NRF24.BR_1MBPS)
radio.s... | null | test.py | test.py | py | 897 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "RPi.GPIO.setmode",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BCM",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "lib_nrf24.NRF24",
"line_... |
14435601 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import matplotlib
import pytest
from rasa_core import train
from rasa_core.agent import Agent
from rasa_core.channels.console import ConsoleOutputChannel... | null | tests/conftest.py | conftest.py | py | 3,560 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "matplotlib.use",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "rasa_core.slots.Slot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "rasa_core.dom... |
290162917 | from flask import Flask, request
import random
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/', methods=['GET'])
def Home():
return "<h1> Hello Flask!</h1>"
@app.route('/api', methods=['GET'])
def Getworkrate():
dic = {'230000':[], '23R000':[]}
dic_DivInfo = { '230000':{ 'DEP':[... | null | api.py | api.py | py | 1,579 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "flask.request.args",
"li... |
420376990 | #!/usr/bin/python3
# coding=utf-8
# ### 基于深度学习的中文分词尝试
# - 基于word2vec + 神经网络进行中文分词
# - 步骤1:使用的是sogou的语料库建立初始的字向量。
# - 步骤2:读入有标注的训练语料库,处理成keras需要的数据格式。
# - 步骤3:根据训练数据建模,使用CNN方法
# - 步骤4:读入无标注的检验语料库,用CNN模型进行分词标注
# - 步骤5:检查最终的效果
# - 参考资料:[中文分词资源](http://www.52nlp.cn/%E4%B8%AD%E6%96%87%E5%88%86%E8%AF%8D%... | null | step3_train_cnn_model.py | step3_train_cnn_model.py | py | 5,364 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pickle.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number":... |
196379599 | from typing import List
from typing import Optional
from fastapi import Depends, HTTPException, status
from sqlalchemy.orm import Session
from .. import tables
from ..database import get_session
from ..models.operations import OperationCreate, OperationUpdate
class OperationService:
def __init__(self, session: ... | null | src/back/services/operations.py | operations.py | py | 1,938 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "database.get_session",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "fasta... |
572183794 | import contextlib
from typing import List, Tuple
from unittest import mock
from alchemy_mock.mocking import UnifiedAlchemyMagicMock
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql.base import PGInspector
from backend.database import startup
from backend.database.objects import Player
fr... | null | tests/utils/database_utils.py | database_utils.py | py | 3,304 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "typing.List",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "backend.server_constants.SERVER_PERMISSION_GROUPS",
"line_number": 20,
"usage_type": "argument"
},
{
"ap... |
39830803 |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import MinMaxScaler
import pandas as pd
import matplotlib.mlab as mlab
from datetime import datetime
import time
from collections import OrderedDict
REGRESSION_FEATURES=["CTN_CPU_REQ", "CTN_MEM_REQ", "CTN_CPU_USAGE", "... | null | analysis_tools/time_series.py | time_series.py | py | 7,007 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "num... |
76075262 | __license__ = """
Copyright (C) 2020 CEA LIST
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | null | freezeGraph.py | freezeGraph.py | py | 1,605 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "tfner.config.Config",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tfner.ner_model.NERModel... |
160439993 | from sklearn.model_selection import train_test_split
from sklearn_crfsuite import CRF
from sklearn_crfsuite.metrics import flat_classification_report, flat_f1_score
def train_model(Xf, y, test_size):
X_train, X_test, y_train, y_test = train_test_split(Xf, y, test_size=test_size)
crf = CRF(algorithm = 'lbfgs',
... | null | utils/model.py | model.py | py | 630 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn_crfsuite.CRF",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn_crfsuite.metrics.flat_f1_score",
"line_number": 18,
"usage_type": "ca... |
164026036 | """
Module that condense all the components of the EMS tested above
"""
# General Imports
import numpy as np
import math
import pdb
from math import *
from scipy import linalg
from sympy import symbols, solve
import sympy as sp
from scipy.optimize import fsolve
from datetime import datetime, timedelta
import json
#... | null | build/lib/lights_ems/lights_ems_estimator.py | lights_ems_estimator.py | py | 16,305 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "numpy.zeros",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.flip",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": ... |
45856585 | import sqlite3
import os
def main():
state = "initialization"
StateMachineActive = True
# added this comment as a test
while StateMachineActive:
# Print current state, comment to silence
print("Current state: " + state)
if state == "initialization":
# Show installe... | null | main.py | main.py | py | 920 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "sqlite3.version",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_nu... |
510935754 | #!/usr/bin/env python
# vim: set fileencoding=utf-8
import os
from glob import glob
from setuptools import setup
def discover_data(path, pattern = "*", prefix = ""):
"""
Iterator to build a list of files suitable for processing
by distutil's package_data.
The individual paths returned will be relati... | null | setup.py | setup.py | py | 1,459 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "os.getcwd",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 22,
... |
358808751 | """
Simple gpio power switch implementation
"""
from gen import PSGen
from gen import PSHWError, PSModuleError, PSOutletError
import struct
import logging
import time
import os
class RPS(PSGen):
self.__SLOT_MAX = 1
self.__GPIOS_BASE_DIR = '/sys/class/gpio'
def __init__(self, *args, **kwargs):
... | null | ps/hw/bbbgpio.py | bbbgpio.py | py | 3,800 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "gen.PSGen",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gen.PSModuleError",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "gen.PSOutletError",
... |
322090696 | import json
from operator import itemgetter
import pandas as pd
import pickle
from hkp.orm import session, Lines
from sqlalchemy.orm import load_only
def save_pickle(obj, filename):
with open(filename, 'wb') as file:
pickle.dump(obj, file, pickle.HIGHEST_PROTOCOL)
def normalize(val, mean, std):
retu... | null | hkp/helperfunctions.py | helperfunctions.py | py | 5,746 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pickle.dump",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "operator.itemgette... |
464854508 | from django.test import SimpleTestCase
from .abstracts import AbstractChoices
class AbstractChoicesTestCase(SimpleTestCase):
"""Tests for `AbstractChoices` class."""
class TestChoices(AbstractChoices):
"""Choices object for testing."""
SOME_CHOICE = 'some_choice'
OTHER_CHOICE = 'othe... | null | TOMIS_npt_adwords/core/tests.py | tests.py | py | 1,117 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "django.test.SimpleTestCase",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "abstracts.AbstractChoices",
"line_number": 8,
"usage_type": "name"
}
] |
49952458 | import pygame # pip install pygame
#################################################################
# 기본 초기화(반드시 해야 하는 것들)
pygame.init()
# 화면 크기 설정
# 가로 크기
screen_width = 480
# 세로 크기
screen_height = 640
screen = pygame.display.set_mode((screen_width, screen_height))
# 화면 타이틀 설정
gameName = '게임 이름' # 게임 이름
pygame.disp... | null | pygames_project/pygame_basic/8_frame.py | 8_frame.py | py | 1,121 | python | en | code | null | code-starcoder2 | 66 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.