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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
383047340 | import auth as a
rootDir="/root/rpi-mqtt-client" # root directory containing all files
###############
dirScripts=rootDir+"/scripts/" # directory containaing scripts to run
logFile=rootDir+"/mqtt_logs" # mqtt logs file
errlogFile=rootDir+"/err_logs"
stdOutlogFile=rootDir+"/stdout_logs"
topicPrefix="rpi/status"
subTo... | null | config_mqtt.py | config_mqtt.py | py | 1,727 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "auth.host",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "auth.host_ssh",
"line_number": 42,
"usage_type": "attribute"
},
{
"api_name": "auth.port_socks",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "auth.host_ssh"... |
206928255 | ## Creates course assessment files for CAC purposes
# Peter Ryan Nov 2018
import pandas as pd
from tabulate import tabulate
import openpyxl
from openpyxl.styles import Protection
from openpyxl.styles import Alignment
from openpyxl.worksheet.datavalidation import DataValidation
from openpyxl.styles import Color, Patte... | null | PLO alignment/PLO_CLO_mapping_success_UGRD_201904.py | PLO_CLO_mapping_success_UGRD_201904.py | py | 10,754 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.datetime... |
225801395 | """
:mod:`lib.frbr_rda` loads FRBR RDA and supporting properties RDF documents
"""
__author__ = 'Jeremy Nelson'
import sys,os
import common
import namespaces as ns
current_dir = os.path.abspath(os.path.dirname(__file__))
fixures_root = os.path.join(os.path.split(current_dir)[0],
'fixures'... | null | lib/frbr_rda.py | frbr_rda.py | py | 929 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
164725482 | import json
import os
import re
import sys
import time
import threading
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
def printLog(info_type="", title... | null | main.py | main.py | py | 9,506 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.strftime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number"... |
205473334 | # Simple ABM simulator in Python
#
# *** Random Walk and Diffusion ***
#
# Copyright 2008-2012 Hiroki Sayama
# sayama@binghamton.edu
import matplotlib
matplotlib.use('TkAgg')
import pylab as PL
import random as RD
import scipy as SP
RD.seed()
populationSize = 100
noiseLevel = 1
def init():
... | null | pycx-0.32/abm-randomwalk.py | abm-randomwalk.py | py | 956 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.gauss",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pylab.cla",
"line_number":... |
8368561 | from django.urls import path
from plant import views
app_name = 'plant'
urlpatterns = [
# 0802 예림 - 작물 게임
path('<int:pk>/',views.plantgame, name='userplant'),
# 씨앗 선택
path('selectSeed/<int:pk>/',views.selectSeed, name='selectSeed'),
# 마이페이지 - 작물일지
path('jakmulDiary/<int:pk>/', views... | null | plant/urls.py | urls.py | py | 705 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "plant.views.plantgame",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "plant.views",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.urls.path... |
140703238 | import base64
from io import BytesIO
import pickle
import dash
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State, ALL
from risk_calculator.mortality.calculator import predict_risk_mort, get_languages
from risk_calculator.features import buil... | null | callbacks_routers/risk_calculators_mortality.py | risk_calculators_mortality.py | py | 8,327 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pickle.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "risk_calculator.mortality.calculator.get_languages",
"line_number": 38,
"usage_type": "call"
},
{
"api_na... |
532516389 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 2 23:29:08 2020
@author: Sam
"""
#################### Control Charts for Variables ####################
import numpy as np
import scipy as sc
import matplotlib.pyplot as plt
#################### X-bar and R control chart ##########
m=30
n=5
... | null | control_chart.py | control_chart.py | py | 6,479 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.normal",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "numpy.mean",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"lin... |
384182305 | #coding:utf-8
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.login import LoginManager
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.mail import Mail
bootstrap = Bootstrap()
login_manager = LoginManager()
moment = Moment()
db = SQLAlch... | null | app_magic_mirror/__init__.py | __init__.py | py | 1,071 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.ext.bootstrap.Bootstrap",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.ext.login.LoginManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.ext.moment.Moment",
"line_number": 12,
"usage_type": "call"
},
{
... |
101814504 | # Author imagean
#!/usr/bin/python
# -*- coding:utf-8
import cv2 as cv
import numpy as np
img = cv.imread("C:/Users/19845/Desktop/02gaussian.jpg",0)
imgtrans = np.zeros((img.shape),np.uint8)
print(img.shape)
for i in range(img.shape[0]):
for j in range(img.shape[1]):
imgtrans[i,j] = (2*(np.log(1+img[i,j]))... | null | Image/03/002logtrans.py | 002logtrans.py | py | 417 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.log",
"line_number": 1... |
121896159 | import sdl2.ext
class Enemy(sdl2.ext.Entity):
def __init__(self, world, sprite, x, y):
self.sprite = sprite
self.sprite.position = (x, y)
self.sprite.depth = 1
self.enemydata = EnemyData()
class EnemyData(object):
def __init__(self, damage, health)... | null | src/enemies.py | enemies.py | py | 430 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sdl2.ext.ext",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sdl2.ext",
"line_number": 3,
"usage_type": "name"
}
] |
650162558 | from django.conf.urls import url
from . import views
urlpatterns = [
#url( r'^index/' , views.index , name = 'index' ),
url( r'^contact/' , views.contact , name = 'contact' ),
url( r'^about/' , views.about , name = 'about' ),
url( r'^letter/' , views.letter , name = 'letter' ),
url( r'^orde... | null | hakiDoggy/urls.py | urls.py | py | 589 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.urls.url",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.co... |
175752781 | __author__ = "Rick Sherman, Nitin Kumar"
__credits__ = "Jeremy Schulman"
import unittest
import os
from nose.plugins.attrib import attr
from jnpr.junos import Device
from ncclient.manager import Manager, make_device_handler
from ncclient.transport import SSHSession
from lxml import etree
from mock import MagicMock, ... | null | tests/unit/factory/test_cfgtable.py | test_cfgtable.py | py | 3,290 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jnpr.junos.factory.loadyaml",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "jnpr.junos.factory.loadyaml",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "... |
408269651 | import pytest
import unittest
import cupy
_test_source1 = r'''
extern "C" __global__
void test_sum(const float* x1, const float* x2, float* y) {
int tid = blockDim.x * blockIdx.x + threadIdx.x;
y[tid] = x1[tid] + x2[tid];
}
'''
# test compiling and invoking multiple kernels in one single .cubin
_test_source... | null | tests/cupy_tests/core_tests/test_raw.py | test_raw.py | py | 4,731 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 82,
"usage_type": "attribute"
},
{
"api_name": "cupy.RawKernel",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "cupy.RawModule",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "cupy.RawModule",... |
342788599 | #Нужно определить кто самый умный(intelligence) из трех супергероев- Hulk, Captain America, Thanos.
import requests
import json
def Superhero_list():
intelligence_dict = {}
response_hulk = requests.get('https://www.superheroapi.com/api.php/2619421814940190/search/Hulk')
response_cap = requests.get('https://... | null | superhero.py | superhero.py | py | 1,049 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
40073126 | import numpy as np
import torch
import yaml
from tqdm import tqdm
def kmean_anchors(path='./data/coco128.yaml', n=9, img_size=640, thr=4.0, gen=1000, verbose=True):
""" Creates kmeans-evolved anchors from training dataset
Arguments:
path: path to dataset *.yaml, or a loaded dataset
... | null | yolov5/anchor_box_kmeans.py | anchor_box_kmeans.py | py | 5,196 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.min",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "torch.float32",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "numpy.argsort",
"line_n... |
590605251 | from pathlib import Path
import random
from babeval.vocab import get_vocab
NUM_SUBJECT_NOUNS_FROM_EACH_LIST = 50 # some number smaller than length of both singular and plural noun lists
NUM_OBJECT_NOUNS_FROM_EACH_LIST = 8 # some number smaller than length of both singular and plural noun lists
NUM_ADJECTIVES = 4
N... | null | babeval/agreement_across_PP/generate.py | generate.py | py | 2,750 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "babeval.vocab.get_vocab",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "babeval.vocab.get_v... |
387161794 | with open('d', 'r') as f:
directions = f.read().splitlines()
from collections import defaultdict
tiles = defaultdict(lambda: True)
#directions = ['esewnw', 'nwwswee']
def parse_d(ds):
directions=defaultdict(lambda: 0)
i = iter(ds)
current = ''
while 1:
try:
current = next(i)
... | null | 24/24-2.py | 24-2.py | py | 2,192 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 58,
"usage_type": "call"
}
] |
336036994 | # -*- coding: utf-8 -*-
from collections import OrderedDict
import pytest
from jussi.upstream.urn import x_jussi_urn_parts
from jussi.upstream.urn import limit_len
from jussi.upstream.urn import stringify
str_len_120 = ''.join('a' for i in range(120))
str_len_99 = ''.join('a' for i in range(99))
str_len_100 = ''.join... | null | tests/test_urn_parts.py | test_urn_parts.py | py | 6,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "jussi.upstream.urn.stringify",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "jussi.upstream.urn.stringify",
"line_number": 116,
"usage_type": "call"
},
{
"api_name": "jussi.upstream.urn.stringify",
"line_number": 127,
"usage_type": "call"
},
... |
626789448 | from sklearn.model_selection import train_test_split
import os
from pathlib import Path
from sklearn.preprocessing import (
OneHotEncoder,
PolynomialFeatures,
StandardScaler,
FunctionTransformer,
)
from sklearn.pipeline import Pipeline
def preprocess_netflow_data(data, label_col):
data = data.fill... | null | src/data/data.py | data.py | py | 3,332 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.FunctionTransformer",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.FunctionTransformer",
"line_number": 36,
"usage... |
426402157 | import pandas as pd
import numpy as np
import time
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.pyplot as plt
def benchmark(model, d_train, d_test, l_train, l_test, title):
print(f"\n{title} Results")
s = ... | null | m6a01_svc.py | m6a01_svc.py | py | 4,144 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.time",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 21,
... |
417754259 | # encoding = utf-8
__author__ = 'wulinkai'
# 净值曲线
def plot_equity_curve(portfolio, benchmark=None):
import matplotlib.pyplot as plt
""" Plot Equity Curves: Strategy vs (optionally) Benchmark
Both arguements are daily balance. """
portfolio.plot(label='strategy')
plt.xlabel('backtes... | null | wlkquant/plot.py | plot.py | py | 1,997 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.ylabel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "m... |
182426939 | # Enter your code here. Read input from STDIN. Print output to STDOUT
from collections import defaultdict
if __name__ == '__main__':
n, m = map(int, input().split())
a = defaultdict(list)
b = []
for x in range(n):
a[str(input())].append(x+1)
for y in range(m):
b.append(str(inpu... | null | Python/7. Collections/DefaultDict Tutorial.py | DefaultDict Tutorial.py | py | 427 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.defaultdict",
"line_number": 6,
"usage_type": "call"
}
] |
50710636 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import logging
import sys
import os
import six
import copy
import operator
import subprocess
from .base import Base
from compose.service import parse_repository_tag
from compose import progress_stream... | null | drag/cli/commands/sync.py | sync.py | py | 5,723 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "base.Base",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "compose.parallel.parallel_execute",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "compose... |
254467505 | #-*-coding:utf-8-*-
# @time :2019/7/11/011 10:02
# @Author :python13_marimo
# @Email :2670622242@qq.com
# @File :reg.py
# @Sofeware :PyCharm Community Edition
from common import do_excel
import unittest
from common import route
from common import request_1
from ddt import ddt,data
import json
from common ... | null | practice_req/test_case/test_add.py | test_add.py | py | 2,306 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "common.logg.logger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "common.logg",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "common.do_excel.doExcel",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "common.do_exce... |
531797787 | import numpy as np
import re
import string
import pandas as pd
from gensim.models import Doc2Vec
from gensim.models.doc2vec import LabeledSentence
from gensim import utils
from nltk.corpus import stopwords
def ClaimClean(Claim):
Claim = re.sub(r"[^A-Za-z0-9^,!.\/'+-=]", " ", Claim)
Claim = Claim.lower().split... | null | getEmbeddings.py | getEmbeddings.py | py | 3,281 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "string.punct... |
128201247 | from app import apfell, auth, links, use_ssl
from app.routes.routes import env
from sanic import response
@apfell.route("/callbacks")
@auth.login_required(user_keyword='user')
async def callbacks(request, user):
template = env.get_template('callbacks.html')
if use_ssl:
content = template.render(links=... | null | app/routes/operations_routes.py | operations_routes.py | py | 1,059 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "app.routes.routes.env.get_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "app.routes.routes.env",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "app.use_ssl",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ap... |
63987950 | def logit(proj_path, proj_name, task_path, task_name, todo, task_start, task_end, task_details, task_notes, time_s, z_event, main_dir, logfile, project_status, status_file):
# import date/time packages
import datetime
from datetime import datetime, date
# import os packages
import os
import... | null | z_scripts/logit.py | logit.py | py | 3,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.date",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "datetime.date... |
402440803 | # This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from kafka import KafkaProducer
import sys
import random
import time
import json
from datetime import datetime, timedelta
... | null | send.py | send.py | py | 1,277 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.utcnow",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "random.randrange",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "kafka.Kaf... |
611789730 | import glob
import os
import pathlib
val_config_folder = 'project_work_dirs/multiple_damage_detection/configs/val_config/'
val_configs = glob.glob(val_config_folder + '*')
dist_test_script = './tools/dist_test.sh'
checkpoint_root = 'project_work_dirs/multiple_damage_detection/work_dirs'
gpu_num = '3'
test_option = '--... | null | run_multiple_val.py | run_multiple_val.py | py | 1,038 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "glob.glob",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_n... |
102248353 | import numpy as np
import torch
from torch import nn as nn
from rlkit.policies.base import ExplorationPolicy, Policy
from rlkit.torch.core import eval_np
from rlkit.torch.distributions import TanhNormal
from rlkit.torch.networks import Mlp
from rlkit.torch.pytorch_util import from_numpy
LOG_SIG_MAX = 2
LOG_SIG_MIN = ... | null | d4rl/rlkit/torch/sac/policies.py | policies.py | py | 6,989 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.log",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "rlkit.torch.networks.Mlp",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "rlkit.policies.base.ExplorationPolicy",
"line_number": 22,
"usage_type": "name"
},
{
"api_name... |
363979414 | """
This package contains all code needed for training on simulator datasets
"""
from packages.dataset import SimulatorDatasetImporter
from packages.batchgenerator import BatchGenerator
from packages.imageaugmentation import ImageAugmenter
from packages.kerasmodels import squeeze_net, nvidia_net, mobile_net
from kera... | null | packages/training.py | training.py | py | 6,346 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "packages.dataset.SimulatorDatasetImporter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "packages.dataset.SimulatorDatasetImporter",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "packages.imageaugmentation.ImageAugmenter",
"line_number"... |
532351815 | from functools import lru_cache
@lru_cache(maxsize=None)
def bus(n):
if n == 1:
return 2
return (bus(n - 1) + 1) * 2
def solve():
t = int(input())
for _ in range(t):
n = int(input())
print(bus(n) // 2)
solve()
| null | kattis/bus.py | bus.py | py | 256 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "functools.lru_cache",
"line_number": 4,
"usage_type": "call"
}
] |
306146552 | import pybullet as p
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
os.sys.path.insert(0, parentdir)
import pybullet_data
from gibson2.data.datasets import get_model_path
import numpy as np
from PIL import Image
import c... | null | gibson2/core/physics/scene.py | scene.py | py | 11,129 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"line... |
504756220 | import numpy as np
from numpy import fft
import matplotlib.pyplot as plt
import scipy.io.wavfile
#Leer los datos
rate_Do,data_Do = scipy.io.wavfile.read("Do.wav")
rate_Sol,data_Sol = scipy.io.wavfile.read("Sol.wav")
#Selecciono menos datos para probar mi implementacion
#data_Do=data_Do[0:1000]
#data_Sol=data_Sol[0:... | null | SebastianDuran_hw2/fourier.py | fourier.py | py | 4,263 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.io.wavfile.io.wavfile.read",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.io",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.wavfile",
"line_number": 7,
"usage_type": "name"
},
{
"api_name"... |
579813730 | from django.conf import settings
import os
import datetime
import re
class Wind:
def __init__(self):
self.air_path = settings.AIR_PATH
self.forecast_dirs = 7
self.HOUR_IN_SECONDS = 3600
def load_data(self):
all_dirs = [file for file in os.listdir(self.air_path)]
all_dir... | null | airMonitor/models/Wind.py | Wind.py | py | 1,746 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.conf.settings.AIR_PATH",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.listdir",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.m... |
384569978 | import mxnet.optimizer as optimizer
from mxnet import ndarray as nd
class NoiseSGD(optimizer.SGD):
"""Noise SGD.
This optimizer accepts the same arguments as :class:`.SGD`.
"""
def __init__(self, scale, **kwargs):
super(NoiseSGD, self).__init__(**kwargs)
print("init noise sgd with",... | null | egs/sre19-av-v/v0.1/steps_insightface/src/common/noise_sgd.py | noise_sgd.py | py | 1,229 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mxnet.optimizer.SGD",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "mxnet.optimizer",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "mxnet.ndarray.random.normal",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "mx... |
22423683 | import io
from django.http import FileResponse, Http404
from reportlab.pdfgen import canvas
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from .models import Post, Comment
from .forms import PostForm, CommentForm
from django.contrib.auth.decorators import login_requi... | null | blog/views.py | views.py | py | 3,589 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name"... |
638907341 | # import
from requests import get
import json
import pathlib
import os
endpoint = "https://prod-content-cdn.chelseafc.com/content/chelseafc/en.newsfeed.v3.0.10.2021.0.all.web.none.order_date_desc.json"
def get_news_data(endpoint):
response = get(endpoint, timeout=20)
if response.status_code >= 400:
rai... | null | python/downloader.py | downloader.py | py | 711 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,... |
122330727 | from flask import Blueprint, Flask, render_template, make_response, request, send_file
from wtforms import Form, FloatField, validators,StringField, IntegerField
from numpy import exp, cos, linspace
from math import pi
import io
import random
import os, time, glob
import numpy as np
import pandas as pd
from matplotlib.... | null | metprob.py | metprob.py | py | 7,190 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.Blueprint",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "wtforms.Form",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "wtforms.StringField",
... |
513762529 | import logging
import os
import sqlalchemy as sa
import sqlalchemy.orm.exc
import pyramid.paster
import pyramid.config
from pym.auth.const import UNIT_TESTER_UID, SYSTEM_UID
import pym.auth.models as pam
from pym.rc import Rc
import pym
import pym.models
mlgg = logging.getLogger(__name__)
class TestingArgs(object):... | null | pym/testing.py | testing.py | py | 2,649 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyramid.paster.paster.setup_logging",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "pyramid.paster.paster",
"line_number": 31,
"usage_type": "attribute"
},
{
"... |
496310528 | import pickle
from pathlib import Path
import cv2
import pandas as pd
import torch
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.sampler import RandomSampler, SequentialSampler
def get_sampled_train_dataframe(df_train, max_freq=100, min_class_freq=10):
valcnt = df_train["hotel_id"].value... | null | peko/dataset/hotels50k_rev2.py | hotels50k_rev2.py | py | 4,665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.concat",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
... |
566488404 | from termcolor import colored
# Optio – One per century as second-in-command to the centurion
# Could also fill several other specialized roles on an ad hoc basis.
class Player:
def __init__(self, name, health, strength, defence, luck):
self.name = name
self.health = health
self.strength ... | null | Optio.py | Optio.py | py | 2,216 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "termcolor.colored",
"line_number": 30,
"usage_type": "call"
}
] |
78856659 | # uncompyle6 version 3.7.4
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04)
# [GCC 8.4.0]
# Embedded file name: build\bdist.win-amd64\egg\running\runningahead.py
# Compiled at: 2020-01-13 13:07:06
# Size of source mod 2**32: 18067 bytes
"""
runningahead - access methods for... | null | pycfiles/runtilities-2.0.1-py3.6/runningahead.cpython-36.py | runningahead.cpython-36.py | py | 11,429 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.basicConfig",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 86,
"usage_type": "attribute"
},
{
"api_name": "logging.getL... |
178042750 | import cv2
import numpy as np
image = cv2.imread('t1.jpg', 0)
image2 = cv2.imread('t1.jpg')
image = cv2.resize(image, (500, 500))
image2 = cv2.resize(image2, (500, 500))
cv2.waitKey(0)
ret, thresh_basic = cv2.threshold(image, 100, 255, cv2.THRESH_BINARY)
cv2.imshow("Thresh basic", thresh_basic)
# thresh_addapt = c... | null | test.py | test.py | py | 1,177 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 8,
... |
7239611 | import tempfile
from torch.utils.data.webdataset import gopen
from torch.testing._internal.common_utils import TestCase, run_tests
class WebdatasetGopenTests(TestCase):
def test_file(self):
with tempfile.TemporaryDirectory() as work:
with gopen.gopen(f"{work}/temp1", "wb") as stream:
... | null | test/test_webdataset_gopen.py | test_webdataset_gopen.py | py | 812 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.testing._internal.common_utils.TestCase",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.utils.data.webdataset.gopen.gopen",
"line_number": 9,
"usag... |
506709840 | from collections.abc import Coroutine
class A(object):
def __init__(self):
self.count = 0
#self.coro = abc()
#
# def send(self, value):
# return self.coro.send(value)
#
# def throw(self, typ, val, tb):
# pass
#
# def close(self):
# pass
def __it... | null | async_downloader/test/test_await.py | test_await.py | py | 884 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "asyncio.futures",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "asyncio.get_event_loop",
"line_number": 43,
"usage_type": "call"
}
] |
606057699 | from django.urls import path, include
from . import views, views_relationship
urlpatterns = [
path('health', views.health),
# 配置“客户”模块接口地址
path('save', views.save),
path('all', views.all),
path('delete_by_id', views.delete_by_id),
path('page_by_condition', views.page_by_condition),
path('up... | null | customer/urls.py | urls.py | py | 657 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
650815542 | import collections
import copy
import functools
import itertools
import logging
import time
import numpy
from scipy import sparse
from .matrix import auto_convert, copy_array, metaedge_to_adjacency_matrix, \
normalize
def category_to_function(category):
function_dictionary = {'no_repeats': dwwc,
... | null | hetmech/degree_weight.py | degree_weight.py | py | 24,810 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.perf_counter",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "time.perf_counter",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "matrix.metaedge_to_adjacency_matrix",
"line_number": 96,
"usage_type": "call"
},
{
"api_name"... |
54117388 | from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from tic_app.Player import AIAgent
from django.http.response import HttpResponse
from django.utils import simplejson
import random
# Create your views here.
legal_first_moves = (0,2,4,6,8)
# index view
@csrf_exempt
def index ... | null | TicTacToe/tic_app/views.py | views.py | py | 1,948 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.randint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.shortcuts... |
312247435 | """
REVISIT: The first implementation does not change as it will catch both cases.
The second is worth reviewing as well as the algo explanation below.
Question: https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/
Suppose an array sorted in ascending order is rotated at some pivot unknown to you... | null | python/coding_challenges/leet_code/find_minimum_in_rotated_sorted_array_ii.py | find_minimum_in_rotated_sorted_array_ii.py | py | 8,340 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 63,
"usage_type": "name"
}
] |
241307102 | import os
import operator
from zope.interface import implements
from zope.interface import Interface, Attribute
from sets import Set
from string import digits
class IDirectory(Interface):
items = Attribute(
"""Return directory listing as (name, obj).""")
class Package(object):
def __init__(self,pa... | null | repoze.pkgindex/trunk/repoze/pkgindex/models.py | models.py | py | 2,496 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "zope.interface.Interface",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "zope.interface.Attribute",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "zope.interface.implements",
"line_number": 27,
"usage_type": "call"
},
{
"api_n... |
70800 | #拟合
import tensorflow as tf
import numpy as np
import random
import matplotlib.pyplot as plt
#使用numpy生成400个随机点,linspace()函数可以生成指定范围内的点
X=np.linspace(-4,4,200,dtype=np.float)#数据类型为float
noise = np.random.random_sample(X.shape)#以给定形状返回[0,1)之间的随机浮点数
Y=X**2 + 1*noise - 25
# reshape
X=np.reshape(X,(200,1))#把X... | null | 神经网络拟合函数.py | 神经网络拟合函数.py | py | 1,981 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.random_sample",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random"... |
107049370 | from time import time
from sqlalchemy import and_
from datetime import datetime
from requests import get as r_get
from re import compile as re_compile
from lxml.html import fromstring as html_fromstr
from .database import db, CurrencyCache
from .constants.converter import ONLINE... | null | currency_converter/app/core/converter.py | converter.py | py | 4,140 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "constants.converter.TIME_TO_LIFE",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "lxml.html.fromstring",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requ... |
412583708 |
'''
Advent of Code - 2016 - Day 11
http://adventofcode.com/2016
Last Updated: 2017-Feb-21
First Created: 2017-Feb-03
Python 3.5
Chris
--- Day 11: Radioisotope Thermoelectric Generators ---
You come upon a column of four floors that have been entirely sealed off from the rest of the building except for a small dedic... | null | 2016/aoc2016_day11.py | aoc2016_day11.py | py | 11,838 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "heapq.heappop",
"line_number": 180,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 188,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 220,
"usage_type": "call"
},
{
"api_name": "itertools.chai... |
308174207 | # Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).
#
#
# Example 1:
#
#
# Input: root = [3,9,20,null,null,15,7]
# Output: [[3],[9,20],[15,7]]
#
#
# Example 2:
#
#
# Input: root = [1]
# Output: [[1]]
#
#
# Example 3:
#
#
# Input: root =... | null | solutions/0102-binary-tree-level-order-traversal/binary-tree-level-order-traversal.py | binary-tree-level-order-traversal.py | py | 1,239 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 46,
"usage_type": "call"
}
] |
289678247 | import json
import random
import time
import string_constants as constants
from messageq import MessageQ
class OrderAcknowledgement:
"""This consumer takes "order placed" requests from the queue and sends acknowledgement
to consumers as SMS and Mail. The mail contains invoice. If invoice is not avail... | null | order_acknowledgement.py | order_acknowledgement.py | py | 2,608 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "string_constants.ORDER_ID",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "string_constants... |
116367721 | import openpyxl
import docx
from pathlib import Path
import re
from openpyxl.styles import Color, Font, colors
import win32com.client as win32
# ft_file_path = Path("c:\\Users\\ehom\\Documents\\IdeaProjects\\Python\\Projects\\asposeWordExcel\\test_source_files\\test 1\\FT\\")
# bt_file_path = Path("c:\\Users\\ehom\\Do... | null | modules.py | modules.py | py | 4,720 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.compile",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Font",
"line_number": 86,
"usage_type": "call"
},
{
"api_name": "openpyxl.styles.Font",
... |
601384000 | import scrapy
from maoyanspider.items import MaoyanspiderItem
from scrapy.selector import Selector
class MaoyanSpider(scrapy.Spider):
name = 'maoyan'
allowed_domains = ['maoyan.com']
start_urls = ['https://maoyan.com/films?showType=3']
def start_requests(self):
url = MaoyanSpider.start_urls[0... | null | week01/maoyanspider/maoyanspider/spiders/maoyan.py | maoyan.py | py | 1,129 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scrapy.Spider",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scrapy.Request",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "scrapy.selector.Selector",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "maoyanspide... |
108449532 | # Copyright (c) OpenMMLab. All rights reserved.
from typing import Optional, Sequence, Union
import numpy as np
from torch import Tensor
from .base_points import BasePoints
class LiDARPoints(BasePoints):
"""Points of instances in LIDAR coordinates.
Args:
tensor (Tensor or np.ndarray or Sequence[Seq... | null | mmdet3d/structures/points/lidar_points.py | lidar_points.py | py | 2,885 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "base_points.BasePoints",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
... |
70453560 | from .tasks import TaskList
from .exceptions import *
from .. import db
from ..models import User
from ..models import Task
from datetime import datetime
def view_tasks(user):
return '还没有开发出来哦'
def query_credits(user):
return '您的现有积分为: %s' % user.credits
commands = {
'任务': view_tasks,
'积分': query_... | null | app/main/handler.py | handler.py | py | 1,550 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.User.query.filter_by",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "models.User.query",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "models.User",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "tasks.... |
161663502 | #!/usr/bin/python
#author :YUQUAN
#projectName :huice_base
#date :
#version :PYTHON3.6
#File :day_02.py
import requests
# url = "http://www.baidu.com/?"
# try:
# kv = {'wd': 'Python'}
# response = requests.get(url, params=kv)
# print(response.url)
# print(len(respon... | null | PythonBase/huice_base/Requests_yu/day_02.py | day_02.py | py | 1,706 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
535077725 | import sqlite3
connection = sqlite3.connect('data.db')
cursor = connection.cursor()
create_table = "CREATE TABLE campaigns (id int, name text, goal text, total_budget int)"
cursor.execute(create_table)
insert_query = "INSERT INTO campaigns VALUES (?, ?, ?, ?)"
campaigns = [
(100000001, 'Test Ad 1', 'Increase R... | null | server/create_tables.py | create_tables.py | py | 622 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlite3.connect",
"line_number": 3,
"usage_type": "call"
}
] |
633329970 | import time
import tkinter as tk
from threading import Thread
from tkinter import ttk
import numpy as np
import pandas as pd
import requests as rq
from bs4 import BeautifulSoup
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from sklearn.linear_model import LinearReg... | null | bitcoin_value_retrieval.py | bitcoin_value_retrieval.py | py | 19,780 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tkinter.Tk",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "tkinter.Frame",
"line_numb... |
161157844 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from bokeh.plotting import figure, output_file, show, ColumnDataSource
from bokeh.io import output_notebook, output_file, save
output_notebook()
from bokeh.models import HoverTool,BoxZoomTool,ResetTool, WheelZoomTool,Legend, LegendItem
from bokeh.la... | null | Geography/tools.py | tools.py | py | 8,707 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bokeh.io.output_notebook",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "bokeh.plotting.figure",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array... |
230258789 | # Using face recognition to point T-Rex head control servos at people in the crowd
# Copyright 2020 Jeff Reuter
#Updated to use Intel DNN processing stick, and to move screen capture to a separate thread
# Requires use of arduino running: rex2020r2.ino
#
# assumes the existence of file conf.json
# import t... | null | servolimittest.py | servolimittest.py | py | 1,926 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "rex_ArduinoCommands.RexCommand",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "cv2.namedWindow",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "time.sleep... |
491738099 | # # # # # # # # # # # # # #
# # convert tas/hur to vap
# # # # # # # # # # # # # #
def convert_to_vap( tas_arr, hur_arr ):
''' create relative humidity from the CRU tas / vap '''
esa_arr = 6.112 * np.exp( 17.62 * tas_arr/ (243.12 + tas_arr) )
# esa_arr = 6.112 * np.exp( 22.46 * tas_arr / (272.62 + tas_arr) )
ret... | null | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_v2/generate_vap_hires_tem_iem.py | generate_vap_hires_tem_iem.py | py | 2,019 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "os.walk",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pathos.mp_map.mp_map",
"line_nu... |
646210667 | import socket
import threading
import math
from enums import Components, Direction, Data, Action
import logging
import sys
import config
sys.path.insert(0, '/home/pi/Desktop/PythonScripts/EasyModbus-1.2.6/easymodbus')
from modbusClient import *
logging.basicConfig(filename='PythonLogger.log', level=logging.DEBUG)
de... | null | Ambush/Python Scripts/RaspberryServer.py | RaspberryServer.py | py | 10,621 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"... |
261820389 | # rstblog/views.py
import os
import pdb
import pytz
#import re
import xml.etree.ElementTree as ET
from copy import copy
from datetime import datetime
from pathlib import Path
from docutils.core import publish_parts
from docutils.core import publish_doctree
from markdown import markdown
from django.conf ... | null | base/rstblog/views.py | views.py | py | 26,990 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "const.TYPES.keys",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "const.TYPES",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "models.Article.objects.filter",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "models.Art... |
242411718 | """
Infinite caching memcached class. Caches forever when passed a timeout
of 0. For Django >= 1.3, this module also provides ``MemcachedCache`` and
``PyLibMCCache``, which use the backends of their respective analogs in
django's default backend modules.
"""
import django
from django.core.cache.backends import memca... | null | johnny/backends/memcached.py | memcached.py | py | 1,848 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.core.cache.backends.memcached.CacheClass",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.core.cache.backends.memcached",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.VERSION",
"line_number": 23,
"usage_type... |
492548998 | # --*-- coding: utf-8 --*--
import sys
import logging
import socket
from functools import reduce
import remote.SocketClient as SocketClient
_logger = logging.getLogger('webserver.' + __name__)
class Local(object):
_alias = 'web'
def __call__(self, *args, **kwargs):
if self._name[:3] == 'web' and self._name.fin... | null | remote/webdispatcher.py | webdispatcher.py | py | 6,768 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "remote.SocketClient.NetRPCTCPClient",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "remote.SocketClient",
"line_number": 64,
"usage_type": "name"
},
{
"api_name... |
569069753 | from __future__ import absolute_import, print_function
import cv2
import numpy as np
import random
def get_color_table(class_num, seed=2):
random.seed(seed)
color_table = {}
for i in range(class_num):
color_table[i] = [random.randint(0, 255) for _ in range(3)]
return color_table
def draw_boxe... | null | utils_image.py | utils_image.py | py | 3,374 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2RGB",
"line_... |
354796442 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.patches as patches
import pw.learn_pw_support as support
def plott(points, ax, *args):
return ax.plot(points[:,0], points[:,1], *args)
def draw_interval(ax, length, center, bwidth, bheight):... | null | plot_uniform_samplers.py | plot_uniform_samplers.py | py | 5,833 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
536433238 | from django import forms
from cities.models import City
from mapwidgets.widgets import GooglePointFieldWidget, GoogleStaticMapWidget, GoogleStaticOverlayMapWidget
class CityCreateForm(forms.ModelForm):
class Meta:
model = City
fields = ("name", "coordinates", "city_hall")
widgets = {
... | null | example/cities/forms.py | forms.py | py | 769 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "cities.models.City",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mapwidgets.... |
70976739 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | null | env/lib/python3.9/site-packages/ansible/modules/cloud/amazon/aws_codepipeline.py | aws_codepipeline.py | py | 11,130 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "botocore.exceptions",
"line_number": 206,
"usage_type": "attribute"
},
{
"api_name": "ansible.module_utils._text.to_native",
"line_number": 207,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 208,
"usage_type": "call"
},
{
... |
58370739 | # coding: utf-8
import json
from contextlib import contextmanager
import logging
import copy
from qfcommon.base.tools import thrift_callex
from qfcommon.server.client import ThriftClient
from qfcommon.base.tools import mask_card
from qfcommon.thriftclient.captcha import CaptchaServer
from qfcommon.thriftclient.qf_cus... | null | bin/util/tools.py | tools.py | py | 10,377 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "qfcommon.server.client.ThriftClient",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "conf.config.CAPTCHA_SERVER",
"line_number": 32,
"usage_type": "argument"
},
{
... |
58621982 | import base64
import json
import requests
class ApiRequest:
def send(self,data:dict):
res = requests.request(data['method'],data['url'],headers=data['headers'])
if data['encoding'] == "base64":
return json.loads(base64.b64decode(res.content))
#把加密过后的响应值发给第三方服务,让第三方去做解密然后返回解密过后... | null | pratice_lesson10_requests/test_request1.py | test_request1.py | py | 1,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.request",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line... |
622731837 | import time
import pygsti
bUseMPI = True
if bUseMPI:
from mpi4py import MPI
g_comm = MPI.COMM_WORLD
g_rank = g_comm.Get_rank()
else:
g_comm = None
g_rank = 0
def runMC2GSTAnalysis(myspecs, mygerms, gsTarget, seed,
maxLs = [1,2,4,8],
nSamples=1000, use... | null | test/test_packages/mpi.old/speedTest.py | speedTest.py | py | 3,428 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "mpi4py.MPI.COMM_WORLD",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "mpi4py.MPI",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pygsti.construction.get_spam_strs",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": ... |
353306689 | """BING API v5 requestor module."""
import json
import urllib
import urlparse
import requests
import constants
session = requests.session()
def search_bing(search_text,
api_key,
offset=None,
limit=None,
market=None,
safesearch=None):
... | null | py_bing_search/_bing_search_v2.py | _bing_search_v2.py | py | 2,446 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.session",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "constants.LIMIT",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "constants.OFFSET",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "constants.... |
295502925 | from flask import Flask, render_template, redirect
from flask_pymongo import PyMongo
import scrape_health
#create an instance of Flask
app = Flask(__name__)
#Use Pymongo to establish Mongo connection
mongo = PyMongo(app, uri="mongodb://localhost:27017/health_app")
#delete in production
mongo.db.collection.drop()
#r... | null | Health_News_Page/app.py | app.py | py | 979 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scrape_health.s... |
206720029 | import models
from train import *
import torch
import torchvision
from torch.utils.data.sampler import SubsetRandomSampler
import torch.nn as nn
import torch.optim as optim
lr = 0.001
batch_size = 64
k=3
n_epochs = 2
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
target_net_type = models.ml... | null | MIA/MNIST/main.py | main.py | py | 3,606 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "models.mlleaks_c... |
135865563 | #/usr/bin/python
import os, errno
import argparse
import shutil
## path and variables usually left unchanged
home = os.getenv("HOME")
dirpath = home + '/git/cfd/cpp/'
templateDir = home + '/templates/git/'
## parse input arguments
parser = argparse.ArgumentParser(description='Sets up the build environment ... | null | setup.py | setup.py | py | 2,033 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.utime",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_num... |
612952082 | import sys
# scipy
import scipy
# numpy
import numpy
# matplotlib
import matplotlib
# pandas
import pandas
# scikit-learn
import sklearn
# Load libraries
import pandas
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classificatio... | null | Nvidia_Jetson_Codebase/Others/v2/pavan02.py | pavan02.py | py | 3,904 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.read_csv",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection",
"line_number": 42,
"usage_type": "name"
},
{
"... |
53044115 | from urllib import urlencode
from django.core.exceptions import ValidationError
from funfactory.urlresolvers import reverse
from mock import ANY, patch
from nose.tools import eq_, ok_
from waffle import Flag
from flicks.base.tests import TestCase
from flicks.base.tests.tools import redirects_
from flicks.users.tests... | null | flicks/videos/tests/test_views.py | test_views.py | py | 11,057 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flicks.base.tests.TestCase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flicks.users.tests.UserProfileFactory.create",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flicks.users.tests.UserProfileFactory",
"line_number": 20,
"usage... |
362331953 | import json
import sys
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import argparse
sys.path.insert(1, '../utils')
from text_utils import TextEncoder, fix_malformed
import pickle
import numpy as np
from transformers import OpenAIGPTTokenizer, OpenAIGPTLMHeadModel
from modeling_openai imp... | null | src/gpt/decode.py | decode.py | py | 7,797 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
225832820 | from numpy.core.multiarray import dtype
from load_mnist import *
import hw1_knn as mlBasics
import numpy as np
#2.a
# Load data - ALL CLASSES
X_train, y_train = load_mnist('training')
X_test, y_test = load_mnist('testing')
print(X_train.shape, y_train.shape, X_test.shape, y_test.shape)
#2.b
index_store... | null | Assignment1/hw1_main_knn.py | hw1_main_knn.py | py | 3,201 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.empty",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "hw1_knn.compute_euc... |
389443461 | '''
The MIT License (MIT)
Copyright (c) 2018 sirtezza451
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, ... | null | main.py | main.py | py | 30,075 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 43,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "os.getenv",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "aiohttp.... |
334764355 | #!/usr/bin/python
# created by Roman Plevka
# this script takes a path as an argument and outputs its structure as a valid JSON object
# currently used attributes: type (file|dir), name (String), size (Number) [, children (Array of Obj)]
# Change history:
# 2014-07-16 by Roman created
# 2014-09-03 by Roman algor... | null | jsfs/cgi-bin/parse_f_n.py | parse_f_n.py | py | 2,302 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.argv",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "time.strftime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path.islink",
"line_num... |
177151000 |
import os
import platform
import numpy as np
import pandas as pd
from pathlib import Path
from netCDF4 import Dataset, num2date
from ascat.read_native.cdr import load_grid
from pyldas.interface import LDAS_io
class HSAF_io(object):
def __init__(self, root=None, version='h119', ext='h120'):
if root... | null | io/ascat.py | ascat.py | py | 5,232 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
359207219 | import json
from unittest.mock import patch, Mock
from django.conf import settings
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from rest_framework import status
class FakeResponse:
def __init__(self, text):
self.text = text
fake_data = [
{
'name... | null | phones/tests/test_api.py | test_api.py | py | 3,584 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "unittest.mock.Mock",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "rest_framework.test.APITestCase",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "rest_fr... |
16511207 | # MIT License
#
# Copyright (c) 2019 Jason Brackman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | null | python/day_07.py | day_07.py | py | 3,022 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "python.helpers.get_lines",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "python.helpers",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "typing.List",
... |
178287637 | #Time complexity: O(n) where n is the length of input array
#Space complexity: O(n) where n is the length of input array
#Does it run on leetcode ? : yes
#Approach: The idea here is to keep track of all the intermediate sum of subarray and result is generated by subtracting k
# from the sum and adding the count[sum-k]... | null | Problem1.py | Problem1.py | py | 679 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.Counter",
"line_number": 10,
"usage_type": "call"
}
] |
366417325 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 13 21:32:21 2019
@author: Admin
"""
import cv2
import matplotlib.pyplot as plt
import numpy as np
img1=cv2.imread(r"D:\Btech practicals\DIP\blackbox_2.jpg",0)
plt.subplot(341)
plt.imshow(img1, cmap = 'gray')
f1 = np.fft.fft2(img1)
fshift1 = np.fft.fftshift(... | null | 2016bec061 Emmanuel Allada/Practical 6 FT/white and black box.py | white and black box.py | py | 1,665 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "cv2.imread",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplot",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyp... |
281189983 | import csv
import logging
# TSV column headers that we care about
TSV_ROW_TYPE = "rowtype"
TSV_CHROM = "CHROM"
TSV_POSITION = "POS"
TSV_INFO_OPOS = "INFO...OPOS"
TSV_IDENTIFIER = "ID"
TSV_REFERENCE = "REF"
TSV_ALTERNATIVE = "ALT"
TSV_INFO_OREF = "INFO...OREF"
TSV_INFO_OALT = "INFO...OALT"
TSV_FILTER = "FILTER"
TSV_SV_... | null | parsers/qc_var_rpt_parser.py | qc_var_rpt_parser.py | py | 13,074 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.Dialect",
"line_number": 230,
"usage_type": "attribute"
},
{
"api_name": "csv.QUOTE_ALL",
"line_number": 237,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 293,
"usage_type": "call"
},
{
"api_name": "csv.DictRead... |
228982289 | import torch
import torch.nn as nn
from args import *
'''
Recurrent cells
'''
class ConvRnnCell(nn.Module):
def __init__(self, in_channels, out_channels):
super(ConvRnnCell, self).__init__()
self.conv1 = nn.Sequential(nn.Conv2d(in_channels+out_channels, out_channels, kernel_size=1))
... | null | model_rec_parts.py | model_rec_parts.py | py | 3,491 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
601275833 |
# Copyright 2017-present Open Networking Foundation
#
# 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 ag... | null | xos/synchronizer/ceilometer/pipeline_agent_module/pipeline_agent.py | pipeline_agent.py | py | 8,499 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.OrderedDict",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "collections.OrderedDict.items",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 37,
"usage_type": "name"
},
{
"api... |
363163302 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2014-2019 Virtual Cable S.L.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notic... | null | server/src/uds/REST/model.py | model.py | py | 45,475 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 58,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "typing.Final",
"line_number": 64,
"usage_type": "attribute"
},
{
"api_name": "typing.... |
166773718 | from galaxy.jobs import JobDestination
import yaml
# Sizes for the different set of resources to be used in Kubernetes
# CPU values are in CPU units (0.1 means 100 mili CPUs)
# Memory values are in Gigabytes.
# TODO: Read YAML file with mappings from here.
__tiny = {'requests_cpu': 0.1,
'limits_cpu': 0.5,... | null | rules/k8s_destinations.py | k8s_destinations.py | py | 7,241 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "galaxy.jobs.JobDestination",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "yaml.load",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "galaxy.jobs.JobDestination",
"line_number": 128,
"usage_type": "call"
}
] |
620935522 | from celery import shared_task
from .models import Announcement, User
from datetime import datetime, timedelta
from django.template.loader import render_to_string
from django.core.mail import EmailMultiAlternatives
from MMORPG_ANNOUNCEMENTS.settings import DEFAULT_FROM_EMAIL
@shared_task
def action():
new_anns = ... | null | announcements/tasks.py | tasks.py | py | 880 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.Announcement.objects.filter",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.Announcement.objects",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "models.Announcement",
"line_number": 11,
"usage_type": "name"
},
... |
149669833 | import requests
try:
r = requests.get("http://warhammer40k.wikia.com/api/v1/Articles/Popular?expand=1&limit=10")
responses = r.json()
if len(responses)!=0:
print ("Test was successfull")
except:
print ("Sorry there was an error!") | null | test.py | test.py | py | 240 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.