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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
562110775 | import argparse
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
from balancing.fully_convolutional import FullyConvolutional
import balancing.utils as balancing_utils
import vis_utils
from envs.puck_stack import PuckStack
NUM_FOLDS = 5
def main(args):
if args.gpus is not None:
... | null | scripts/balancing/fully_convolutional/train.py | train.py | py | 5,851 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "balancing.fully_convolutional.FullyConvolutional",
"line_number": 35,
"usage_type": "call"
},
{
"api_... |
400478185 | from utils.exceptions import BasicException
PREFIX_CODE = 'ge'
BASIC_ERROR_500 = {'error_code': PREFIX_CODE + '00', 'error_message': 'General Error', 'parameters': {}}
BASIC_ERROR_404 = {'error_code': PREFIX_CODE + '01', 'error_message': 'Not Found Error', 'parameters': {}}
class ParameterDoesNotExists(BasicExcept... | null | app/utils/exceptions/general_exceptions.py | general_exceptions.py | py | 731 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "utils.exceptions.BasicException",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "utils.exceptions.BasicException",
"line_number": 17,
"usage_type": "name"
}
] |
518696443 | # from some website
import bpy
# Define the coordinates of the vertices. Each vertex is defined by 3 consecutive floats.
coords=[(-1.0, -1.0, -1.0), (1.0, -1.0, -1.0), (1.0, 1.0 ,-1.0), \
(-1.0, 1.0,-1.0), (0.0, 0.0, 1.0)]
# Define the faces by index numbers. Each faces is defined by 4 consecutive integers.
# For ... | null | blender-studies/pyramids.py | pyramids.py | py | 955 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bpy.data.meshes.new",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "bpy.data",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "bpy.data.objects.new",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bpy.data",
... |
574870602 | class record:
def __init__(self, atrib):
self.id_customer = atrib[0]
self.cpf_cnpj = atrib[1]
self.nm_customer = atrib[2]
self.is_active = atrib[3]
self.vl_total = atrib[4]
self.is_calc = 0
# Populando lista com registros a serem inseridos
recordlis... | null | main.py | main.py | py | 2,281 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pyodbc.connect",
"line_number": 34,
"usage_type": "call"
}
] |
304366983 | # coding=UTF-8
import requests
from bs4 import BeautifulSoup
class ExtractWord:
def __init__(self):
pass
def extract_word(css_url, word_code):
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/'
'537.36 (KHTML, like Gecko) ... | null | clawReviews/ExtractWord.py | ExtractWord.py | py | 1,171 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 27,
"usage_type": "call"
}
] |
542096907 | from typing import List, Tuple
import bgmi.protocol.source
from bgmi.protocol import source
class MySource(source.Base):
name = "my source"
id = "my-source"
def fetch_series_and_subtitle_group(
self,
) -> Tuple[List[source.Series], List[source.Subtitle]]:
return (
[
... | null | examples/source.py | source.py | py | 2,286 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bgmi.protocol.source.Base",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "bgmi.protocol.source",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "bgmi.protocol.source.protocol.source.Series.parse_obj",
"line_number": 16,
"usage_type"... |
74753454 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
optional = {
"null": True,
"blank": True,
}
class Business(models.Model):
BUSINESS_SINGLE = 1
BUSINESS_PARTNERSHIP = 2
BUSINESS_CORPORATION = 3
BUSINE... | null | core/models.py | models.py | py | 6,600 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.db.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 37,
"usage_type": "call"
},
{
"api_name"... |
337160037 | # global imports
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import keras.layers as layer
import keras.models as models
# local imports
filedir = os.path.dirname(os.path.realpath(__file__))
basedir = os.path.dirname(filedir)
sys.path.append(basedir)
#import DRACO_Frameworks.CNN.data_frame ... | null | train_scripts/train_CNN_single_custom.py | train_CNN_single_custom.py | py | 2,005 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"... |
220756712 | #!/usr/bin/env python
# coding: utf-8
from helpers import *
from mobject.tex_mobject import TexMobject
from mobject import Mobject
from mobject.image_mobject import ImageMobject
from mobject.vectorized_mobject import *
from animation.animation import Animation
from animation.transform import *
from animation.simple_... | null | eost/10-cartesian-product-cz.py | 10-cartesian-product-cz.py | py | 77,345 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "topics.common_scenes.OpeningTitle",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "topics.common_scenes.OpeningQuote",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "topics.common_scenes.OpeningTitle",
"line_number": 52,
"usage_type": ... |
597817885 | from random import choice
from markdown2 import Markdown
from django import forms
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from . import util
def index(request):
"""
Show list of encyclopedia entries, ... | null | 1_Wiki/encyclopedia/views.py | views.py | py | 5,760 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.shortcuts.render",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 51,
"usage_type": "call"
},
{
"api_name"... |
227159912 | import paho.mqtt.client as paho
import json
import sys
#from seguidor import Seguidor
import json
import time
from subprocess import call
import os
import subprocess
import requests
broker = "180.120.10.50"
mqttPort = 1883
mqttUser = "xpmhnkae"
mqttPassword = "qwpGvjcKjtGq"
mac_mati = "48:2c:a0:6a:36:c2"
mac_mati2 = ... | null | sniffer-rts-cts/process_mqtt.py | process_mqtt.py | py | 2,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.loads",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "time.asctime",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_numb... |
67136787 | import ccxt,schedule,warnings,time,ast,config
warnings.filterwarnings('ignore')
from dateutil.tz import tzlocal
from datetime import datetime
from random import randint
from random import seed
import pandas as pd
import numpy as np
from rich import print, pretty
pretty.install()
# login
ccxt.binanceus({ 'options':{ 'a... | null | Binance Trading Bot/binance_bot.py | binance_bot.py | py | 17,666 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "rich.pretty.install",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "rich.pretty",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ccxt.binanceus... |
485776424 | # -*- coding: utf-8 -*-
"""
Spyder Editor
Das ist ein Versuch, um zu überprüfen wie A:
Convolution zusammen mit Python/Scipy funktioniert
und B:
Ob diese "Zitterer" wirklich einen Einfluss auf die
Auswertung haben
"""
#Import Scipy
import scipy as sc
import scipy.io
import scipy.signal
imp... | null | Versuch_Faltung_Convolution.py | Versuch_Faltung_Convolution.py | py | 1,437 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "scipy.io.loadmat",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_... |
558264979 | import numpy as N
import scipy.io.netcdf as S
import matplotlib as mpl
import matplotlib.pyplot as plt
import mpl_toolkits.basemap as bm
import os
import datetime
import pandas as pd
import netCDF4 as N4
#KORNING = '2018-01-18_00z'
###########
#VARIABLES#
###########
Filobjekt = N4.Dataset('/nobackup/smhid12/sm_m... | null | PYTHONSCRIPTS/Create_Input_Sounding.py | Create_Input_Sounding.py | py | 5,534 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 5... |
165611122 | """
Wrapper around the python lib - pass in a string or a file of user agent strings
Run:
# python main.py <inputFormat: string|file> <uaString|filePath> <delimiter: \t|,|json>
When running from file, the output file with generate a file with the following headers:
user_agent,device,os,os_major,... | null | ua_parser/user_agent_wrapper.py | user_agent_wrapper.py | py | 4,554 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "user_agent_parser.Parse",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_... |
107426478 | import WC.session as ss
import WC.dbconnector as db
import WC.dummymaker as dm
from datetime import datetime
import random
class Photo:
def __init__(self):
self.conn = None
self.session = ss.Session()
self.photo_id = 1
def register_photo(self, dict_info):
"""
... | null | ActiveAgingAdvisorySystem/photo.py | photo.py | py | 12,442 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "WC.session.Session",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "WC.session",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "datetime.dat... |
283257964 | #!/usr/bin/env python3
import os
import sys
import yaml
import shlex
import utils.common as common
from pykwalify.core import Core
from pykwalify.errors import SchemaError
class SuiteParser:
def __init__(self, filepath):
self.contexts = []
self.met_required = False
self.filepath = file... | null | utils/parser.py | parser.py | py | 7,013 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "yaml.safe_load_all",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pykwalify.errors.SchemaError",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pykwalify.errors.SchemaError",
"line_number": 36,
"usage_type": "call"
},
{
"api_... |
487541460 | import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from gui import Ui_Form
def First_funk(firs,second):# Функція (p-1)*(q-1)
fn = (firs - 1) * (second - 1)
return fn
def egcd(e, fn):
if e == 0:
return (fn, 0, 1)
else:
gcd, d, y = egcd(fn % e, e)
return (gcd, y - (fn//e) * d, d)
def ... | null | factorize/main.py | main.py | py | 2,200 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "PyQt5.QtWidgets.QApplication",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "sys.argv",
"line_number": 70,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWi... |
41890383 | from bs4 import BeautifulSoup
import sys
html = """
<html>
<body>
<h1>파이썬 BeautifulSoup 공부</h1>
<p>태그 선택자</p>
<p>CSS 선택자</p>
</body>
</html>
"""
print(html)
bsObj = BeautifulSoup(html, "html.parser")
print('bsObj', type(bsObj))
print('prettify', bsObj.prettify())
h1 = bsObj.html.body.... | null | bs02.py | bs02.py | py | 623 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 15,
"usage_type": "call"
}
] |
480292325 | from __future__ import print_function, division
import os
from PIL import Image
import numpy as np
from torch.utils.data import Dataset
from mypath import Path
from torchvision import transforms
from dataloaders import custom_transforms as tr
class JingweiSegmentation(Dataset):
"""
PascalVoc dataset
"""
... | null | code/model_2/dataloaders/datasets/jingwei.py | jingwei.py | py | 2,838 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mypath.Path.db_root_dir",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mypath.Path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.... |
424497139 | #!/usr/bin/env python3
import json
import os
import random
import argparse
DATA_DIR = os.path.join('/opt', 'motivate', 'data')
def print_quote(author=None):
random_quote = get_random_quote(author)
quote_str = "\033[1;36m" + "\"" + random_quote['quote'] + "\"" + "\033[1;m"
author_str = "\033[1;35m" + "-... | null | motivate/motivate.py | motivate.py | py | 1,342 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": ... |
653776758 | ''' Simple Linear Regression '''
# ***** Simple-Linear-Regression Intution *****
# Here, we have a simple formula: `y = b0 + b1.x`
# where, x = independent variable
# y = dependent variable
# b1 = quantifier of how `y` will change with the unit change in `x`.
# b0 = the constant quantifier... | null | 02_Supervised/01_Regression/01_Simple_Linear_Regression/source.py | source.py | py | 5,736 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 37,
"usage_type": "call"
... |
267492484 | # coding=utf-8
"""
demo2 can work well with celery==3.1.25 and celery==4.1.0
"""
import logging
from datetime import timedelta
from celery import Celery
from celery.signals import setup_logging
from log_util import LogUtil
app = Celery('task_demo2', broker='redis://127.0.0.1:6379/1')
app.conf.beat_schedule =... | null | demo2.py | demo2.py | py | 789 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "celery.Celery",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "log_util.LogUtil",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",... |
634665912 | from datetime import datetime
from django.conf import settings
from django.contrib.auth.tokens import default_token_generator
from django.core.mail import send_mail
from django.db.models import Avg
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from django_filters.rest_framework im... | null | api/views.py | views.py | py | 6,032 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "models.User.objects.all",
"line_number": 27,
"usage_type": "call"
},
... |
107924451 | import re
import tweepy
import pandas as pd
from textblob import TextBlob
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''
TRACK_WORDS = ['Microsoft', 'MSFT']
class MyStreamListener(tweepy.StreamListener):
'''
Tweets are known as “status updates”. So the Status class in tweep... | null | Sentiments_Stocks/api/MyStreamListener.py | MyStreamListener.py | py | 2,513 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "tweepy.StreamListener",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "textblob.TextBlob",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandl... |
46006031 | import os
from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt
import prettyplotlib as ppl
from matplotlib.font_manager import FontProperties
ade = np.load('../ExampleCode/ConvCompair/ATEMlineADE.npz')
conv = np.load('../ExampleCode/ConvCompair/ATEMlineConv.npz')
nc = np.load('../E... | null | phdThesisDave/phdThesis/AdeFwd/FigureCode/ConvADE_decay.py | ConvADE_decay.py | py | 2,102 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.load",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.logspace",
"line_number": 18... |
109137911 | from copy import deepcopy
import attr
import re
import pycparser
from pycparser import c_ast
from pycparser.c_generator import CGenerator
def toC(node):
return toC.gen.visit(node)
toC.gen = CGenerator()
def find_typedecl(node):
while not isinstance(node, c_ast.TypeDecl):
node = node.type
return no... | null | hpy/tools/autogen/parse.py | parse.py | py | 6,340 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pycparser.c_generator.CGenerator",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pycparser.c_ast.TypeDecl",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "pycparser.c_ast",
"line_number": 13,
"usage_type": "name"
},
{
"ap... |
259984082 | from inspect import getmodule
import sys
import attr
import pytest
@attr.s
class ConfigWrapper(object):
"""For proxying `__setattr__` calls as `_configure` to `Konfig` instances."""
config = attr.ib()
def __setattr__(self, key, value):
if key == "config":
self.__dict__[key] = value
... | null | src/konfetti/pytest_plugin.py | pytest_plugin.py | py | 1,450 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "attr.ib",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "attr.s",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "sys._getframe",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "inspect.getmodule",
"line_number... |
464972377 | import os
import pylab as pl
import argparse
def find_min_max_file_len(f):
file_list = os.listdir(".")
file_len_arr = pl.array([])
for i,j in enumerate(os.listdir(".")):
if "spool" in j:
str_num = j[(j.find("-")+1):]
# could be several file names. Just set up to do vert_... | null | Loop/WorkWithVACCFiles/avg_tgther.py | avg_tgther.py | py | 4,391 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pylab.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 16,
... |
651077957 | import os
import numpy as np
import cv2
import scipy.io as sio
import math
from sklearn import preprocessing
from sklearn.externals import joblib
from libs.configs import cfgs
def draw_r2cnn_box(img, boxes, labels, scores):
img = img + np.array(cfgs.PIXEL_MEAN)
labels = labels.astype(np.int32)
img = np.ar... | null | tools/mylibs.py | mylibs.py | py | 17,508 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "libs.configs.cfgs.PIXEL_MEAN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "libs.configs.cfgs",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "numpy... |
218424478 | from django.test import TestCase, RequestFactory
from tx_highered.factories import InstitutionFactory, EnrollmentFactory
from tx_highered.views import (HomeView, LATEST_ENROLLMENT_YEAR,
InstitutionDetailView)
class HomeViewTest(TestCase):
def setUp(self):
self.factory = RequestFactory()
def test... | null | exampleproject/test_tx_highered/tests/test_views.py | test_views.py | py | 1,881 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.TestCase",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tx_highered.views.HomeView.as_view",
"line_number": 14,
"usage_type": "call"
},
{
... |
514718318 | from wikidata_villes_pas_capitales import dictionnaire_villes
# pip install sparqlwrapper
# https://rdflib.github.io/sparqlwrapper/
from SPARQLWrapper import SPARQLWrapper, JSON
endpoint_url = "https://query.wikidata.org/sparql"
query = """
SELECT DISTINCT ?countryLabel ?capitalLabel ?population ?continentLabel ?pre... | null | wikidata.py | wikidata.py | py | 2,292 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "SPARQLWrapper.SPARQLWrapper",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "SPARQLWrapper.JSON",
"line_number": 32,
"usage_type": "argument"
},
{
"api_name": "wikidata_villes_pas_capitales.dictionnaire_villes",
"line_number": 47,
"usage_type": "... |
628204970 | # -*- coding: utf-8 -*-
"""
Do load/dump tests on known valid and invalid documents.
"""
import os
import datetime
from odin.codecs import json_codec
from odin import exceptions
from odin.datetimeutil import utc
from ._test_case import TestCase
from .resources import *
FIXTURE_PATH_ROOT = os.path.join(os.path.dirna... | null | tests/test_kitchensink.py | test_kitchensink.py | py | 2,330 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "_test_case.TestCase",
"... |
343121721 | import time
import csv
from itertools import zip_longest
from sensors import Sensor
from valve import Valve
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from dash.exceptions import PreventUpdate
import Adafruit_BBIO.GPIO as GPIO
# Data F... | null | front_end.py | front_end.py | py | 21,365 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "valve.Valve",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "valve.Valve",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "valve.Valve",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "valve.Valve",
"line_number": ... |
198995697 | from rest_framework import serializers
from department.models import Department
class DepartmentSerializer(serializers.ModelSerializer):
"""Department serializer"""
class Meta:
model = Department
exclude = ['created_at', 'updated_at', 'is_deleted', 'deleted_at', ]
def to_int... | null | department/api/serializers.py | serializers.py | py | 633 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "department.models.Department",
"line_number": 10,
"usage_type": ... |
351264560 | from django.conf.urls import url, include
from MyPortfolio_App import views
# TEMPLATE TAGGING
app_name = "read_more"
urlpatterns = [
# readmore/id=1
url(r'^(?P<Blog_id>[0-9]+)/$', views.Blog_readmore, name="readmore"),
url(r'^fill_page/$', views.form_view, name="formview"),
]
| null | MyPortfolio_App/urls.py | urls.py | py | 305 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MyPortfolio_App.views.Blog_readmore",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "MyPortfolio_App.views",
"line_number": 10,
"usage_type": "name"
},
{
... |
97798070 | import typing as ty
import numpy as np
import tensorflow as tf
import pandas as pd
import flamedisx as fd
export, __all__ = fd.exporter()
o = tf.newaxis
@export
class Block:
"""One part of a BlockSource model.
For example, P(electrons_detected | electrons_produced).
"""
dimensions: ty.Tuple[str]
... | null | flamedisx/block_source.py | block_source.py | py | 14,907 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flamedisx.exporter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tensorflow.newaxis",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.Tuple",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "typing.Tu... |
270910724 | from django.conf.urls import url
from usaspending_api.search.v2.views.search import SpendingOverTimeVisualizationViewSet, \
SpendingByCategoryVisualizationViewSet, SpendingByGeographyVisualizationViewSet, SpendingByAwardVisualizationViewSet,\
SpendingByAwardCountVisualizationViewSet
urlpatterns = [
url(r'^... | null | usaspending_api/search/v2/urls_search.py | urls_search.py | py | 733 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "usaspending_api.search.v2.views.search.SpendingOverTimeVisualizationViewSet.as_view",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "usaspending_api.search.v2.views.search.Spe... |
585381059 | from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
# try to load saved client credentials
gauth.LoadCredentialsFile("creds_detect_motion.txt")
if gauth.credentials is None:
# authenticate if they're not there
print('using LocalWebserverAuth ...')
gauth.LocalWebse... | null | google_drive/py_drive_with_saved_credentials.py | py_drive_with_saved_credentials.py | py | 830 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pydrive.auth.GoogleAuth",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pydrive.drive.GoogleDrive",
"line_number": 22,
"usage_type": "call"
}
] |
35865597 | from __future__ import annotations
import random
from typing import TYPE_CHECKING
import dice
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from rings.utils.converters import CoinConverter, MoneyConverter
from rings.utils.ui import Paginator
from rings.utils.ut... | null | rings/decisions/decisions.py | decisions.py | py | 5,723 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 21,
"usage_type": "name"
},
{
"api_name"... |
505713608 | # coding: utf-8
import csv
import glob
import timeit
import fdb
import lib.system as sys
import lib.mensagens as msg
from dbfread import DBF
from dbfread import FieldParser
from dbfread import InvalidValue
from lib.config import ConfigIni
def conexao(**kwargs):
dsn = kwargs.get("dsn")
# Conexão banco de dad... | null | lib/export.py | export.py | py | 5,558 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "glob.glob",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "fdb.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "fdb.DatabaseError",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "lib.system.print_message... |
3834110 |
#Needed later on for pygames music player
import sys
sys.path.append(r"\Audio")
import numpy as np
import matplotlib as mpl
import cv2
import json
import os
import time
# Start the camera at the beginning of programm
cap = cv2.VideoCapture(0)
# Setting up the bool for getting the initial value
gotIn... | null | OpenCVMusicPlayer01/OpenCVMusicPlayer01.py | OpenCVMusicPlayer01.py | py | 3,054 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_nu... |
32354482 | from collections import deque
class Solution(object):
def widthOfBinaryTree(self, root):
"""
:type root: TreeNode
:rtype: int
"""
if not root:
return 0
big_int = 10 ** 10
ans = 1
que = deque()
que.append((root, 0))
levels... | null | LeetCode/600/652.py | 652.py | py | 846 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
}
] |
307548347 | import os
import sqlite3
# Dictionary factory for SQLite query results
###########################################
def _dict_factory(cursor, row):
"""
Replace the row_factory result constructor with a dictionary constructor.
Args:
cursor: (object) the sqlite3 database cursor object.
row: ... | null | plantcv/parallel/db.py | db.py | py | 2,453 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.isfile",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "os.remove",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_num... |
531767238 | import json
from flask import Flask, Blueprint, request, redirect, g, render_template, Session, url_for, jsonify
import requests
import base64
import urllib
authenticator = Blueprint('authentication', __name__)
session = Session()
# Authentication Steps, paramaters, and responses are defined at https://developer.spot... | null | server/authentication.py | authentication.py | py | 3,979 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.Session",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_n... |
596451382 |
import cv2
import numpy as np
from torch.utils.data import Dataset
from utility.utils import read_json, get_one_hot_vector
class Single_Classification_Dataset(Dataset):
def __init__(self, image_dir, transforms, json_path, class_names):
self.image_dir = image_dir
self.data_dic = read_json(json_pa... | null | 2. DeepLearning Tutorials/2.5. Evaluation/core/data.py | data.py | py | 1,092 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "utility.utils.read_json",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 32,
"usage_type": "call"
}
] |
574444681 | # Importar librerias
import RPi.GPIO as GPIO
import time
import os
from git import Repo
from gpiozero import CPUTemperature
# Esta misma Carpeta
PATH_OF_GIT_REPO = os.getcwd()
# Setiar GPIO modo numeracion
GPIO.setmode(GPIO.BOARD)
freq = 53.5 # 53.5 Hz de pulso
# Configuracion de Pines
GPIO.setup(7, GPIO.O... | null | Numerico/herramientas_v2.py | herramientas_v2.py | py | 3,909 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO.setmode",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "RPi.GPIO",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "RPi.GPIO.BOARD",
"line_number"... |
287548209 | #!/usr/bin/env python3
#
# https://github.com/psf/requests
# requests 2.22.0 (2019-05-15)
# https://requests.kennethreitz.org/en/master/
# https://pypi.org/project/requests/
#
import yaml, requests
# def readconfig(filename):
# with open(filename) as yamlfile:
# try:
# config = (yaml.safe_loa... | null | read-config.py | read-config.py | py | 1,523 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.exceptions",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
... |
148640300 | #!/usr/bin/evn python3
from pylib import *
#from pylab import *
#-------misc-------------------------------------------------------------------
def load_bathymetry(x,y,fname,z=None,fmt=0):
'''
load bathymetry data onto points(xy)
Input:
fname: name of DEM file (format can be *.asc or *.npz)
Ou... | null | Utility/mylib.py | mylib.py | py | 66,551 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cloudpickle.dumps",
"line_number": 402,
"usage_type": "call"
},
{
"api_name": "pickle.loads",
"line_number": 447,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 499,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
... |
376329045 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""Implements a setuptools ``build_website`` command."""
__author__ = ('Lance Finn Helsten',)
__version__ = '0.7.4'
__copyright__ = """Copyright (C) 2014 Lance Helsten"""
__docformat__ = "reSt... | null | ftpysetup/website/build_website.py | build_website.py | py | 6,537 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.version_info",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "setuptools.Distribution",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "setuptools.Command",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_na... |
432805733 | import pysgpp
import numpy as np
from argparse import ArgumentParser
from okushiri_precalc_distributed import calculate_missing_values
import sys
sys.path.append('/home/rehmemk/git/anugasgpp/Okushiri') # nopep8
from sgppOkushiri import okushiri # nopep8
if __name__ == "__main__":
parser = ArgumentParser(descrip... | null | precalc/precalcSparseGridPoints.py | precalcSparseGridPoints.py | py | 2,012 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sgppOkushiri.okus... |
110565150 | from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import WebDriverException
import time
import unittest
MAX_WAIT = 10
class NewVisitTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Fi... | null | functional_tests/tests.py | tests.py | py | 3,623 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.LiveServerTestCase",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 12,
"usage_type": "name"
},
{
"api_... |
486702220 | # How many total Characters are there?
from charactercreator.models import *
from armory.models import *
chars = Character.objects.all()
# 302
len(chars)
# How many of each specific subclass?
sub_classes = {subclass.__name__.lower():[] for subclass in chars[0].__class__.__subclasses__()}
for char in chars:
if h... | null | queries.py | queries.py | py | 1,354 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "functools.reduce",
"line_number": 59,
"usage_type": "call"
}
] |
307752150 | # -*- coding: UTF-8 -*-
"""网络信息收集模块
"""
from datetime import datetime
import psutil
from . import BaseCollector
class NetCollector(BaseCollector):
"""网络信息收集类
属性:
last_net_info: 上次调用该模块的网络信息
last_net_time: 上次调用该模块的时间
"""
def __init__(self):
self.last_net_info = None
se... | null | agent/code/collector_module/net_collector.py | net_collector.py | py | 2,163 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "psutil.net_io_counters",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "psutil... |
237411615 | import datetime
from django.test import TestCase
try:
from mock import Mock, patch
except ImportError:
raise ImportError("Mock is a requirement for la_facebook tests")
try:
from django.test.client import RequestFactory
except ImportError:
raise ImportError("callback tests require Django > 1.3 for Requ... | null | la_facebook/tests/test_callbacks.py | test_callbacks.py | py | 3,247 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.test.client.RequestFactory",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mock.Mock",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "djan... |
420403609 | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
import numpy as np
from common.tf_layer_test_class import CommonTFLayerTest
class TestReduceOps(CommonTFLayerTest):
def _prepare_input(self, inputs_dict):
for input in inputs_dict.keys():
inputs_d... | null | tests/layer_tests/tensorflow_tests/test_tf_Reduce.py | test_tf_Reduce.py | py | 2,723 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "common.tf_layer_test_class.CommonTFLayerTest",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "numpy.random.random",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
... |
600013747 | # -*- coding: utf-8 -*-
from collections import defaultdict
from datetime import date, datetime
from operator import attrgetter
from cachetools import cachedmethod, keys
from ._provider import Provider
class GrandTrunk(Provider):
"""
Service offers day exchange rates based on Federal Reserve and European C... | null | gold_digger/data_providers/grandtrunk.py | grandtrunk.py | py | 4,148 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "_provider.Provider",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "cachetools.cachedmethod",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "operator.attrgetter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cachet... |
158105645 | """Class responsible for packaging compiled binaries based on install config
"""
# std lib imports
import os
import shutil
import sys
from sys import platform
import datetime
import time
import subprocess
# External package used to identify linux distribution version. Note that this adds external
# dependancy, but it... | null | installSynApps/driver/packager_driver.py | packager_driver.py | py | 22,558 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "installSynApps.io.file_generator.FileGenerator",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "installSynApps.io.file_generator",
"line_number": 62,
"usage_type": "name"
},
{
"api_name": "sys.platform.startswith",
"line_number": 69,
"usage_type"... |
272209087 | from django.shortcuts import render_to_response
# Create your views here.
# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.http import HttpResponseRedirect, FileResponse
from django.core.urlresolvers import reverse
from django.con... | null | file/views.py | views.py | py | 5,237 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "hashlib.sha1",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "file.models",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "file.models.read",
"li... |
490103832 | from Mj_Common.common import get_msg_conf
import requests
import json
url = get_msg_conf('admin_url', 'api_url')
class Web_api_common:
'''web_api公用方法'''
def __init__(self):
self.web_info = get_msg_conf('admin_user', 0)
self.head = {'Content-Type': 'application/json'}
def web_login(self):
... | null | Mj_API/web_api.py | web_api.py | py | 11,266 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "Mj_Common.common.get_msg_conf",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "Mj_Common.common.get_msg_conf",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 18,
"usage_type": "call"
},
{
"api_name... |
378136936 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 3 00:18:42 2020
@author: ammar
"""
import json
import csv
#print(type(packets))
#print(packets)
unique_feats=[]
collabels=None
def recprintvals(obj,features,features2,key=None): #recursive function to extract features
global unique_feats
... | null | feature_extractor-master/packet_feat_ext.py | packet_feat_ext.py | py | 4,435 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "csv.writer",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "csv.QUOTE_MINIMAL",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 102,
"usage_type": "call"
}
] |
130879746 | '''
Created on Sep 18, 2017
Modified on Nov 25, 2019
@author: snownontrace
'''
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy import stats
def scatterPlot(yA, yB, title): # deals with only 2 data sets
fig = plt.figure(figsize=(4,4))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
... | null | ScatterPlotFromCSV.py | ScatterPlotFromCSV.py | py | 2,505 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.std",
... |
383870808 | # coding=utf-8
"""This module, useful_file_operations.py, will contain useful functions to run."""
# Used for IDE typing.
from typing import List
# Needed for running bash commands.
from asset_importer_docker.universal_code import bash_runner
# Needed for running regular expressions.
import re
# Needed for calculatin... | null | z_code_archive/useful_file_operations.py | useful_file_operations.py | py | 10,756 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "hashlib.md5",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 6... |
371937369 | # Copyright (c) 2021 Leiden University Medical Center
#
# 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, me... | null | tests/test_shm_csr.py | test_shm_csr.py | py | 3,675 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pathlib.Path",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "tempfile.mktemp",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "shutil.copytree",
"line... |
258774776 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from datetime import datetime
import json
import elasticsearch
import argparse
import logging
import sys, os, time, atexit
from signal import SIGTERM #needed for Daemon
from httplib2 import Http #needed for put_dict
class Daemon:
"""
A generic daemon class.
... | null | helperscripts/es2json.py | es2json.py | py | 22,333 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.fork",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.stderr.write",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "sys.stderr",
"line_number": 35,... |
517013684 | #!/usr/bin/env python
"""
plot_sub_dir_ROIs
This is a command line executable which takes inputs
This script will find all .json dictionary with a file name (that should be diagnostic outputs from reconstructions).
Based upon command line input filters, the script will break down the paths to the files into keywords ... | null | bin/plot_sub_dir_ROI.py | plot_sub_dir_ROI.py | py | 7,620 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "matplotlib.pyplot.rcParams.update",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 29,
"usage_type": "name"
},
{
... |
402862306 | from django.shortcuts import render,get_object_or_404
import django.http as http
from django.urls import reverse
from todolistapp.models import Task
from todolistapp.customutil import checkdue
import datetime
from dateutil.relativedelta import relativedelta
#
class InvalidValueError(Exception):
def __init__(self,... | null | todolist/todolistapp/views.py | views.py | py | 4,135 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.http",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "django.urls.reverse",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "todo... |
78872410 | #!/usr/bin/env python
"""
UCC
Undulation Curvature Coupling (v5, ca 2017.12.06)
...
"""
import time,copy
import scipy
import scipy.optimize
import scipy.interpolate
machine_eps = eps = np.finfo(float).eps
###
### !!! LEGACY CODE NEEDS TO BE REWORKED
###
def basic_undulation_fitter(qs,hqs,area,**kwargs):
"""
Fit ... | null | plot-ucc.py | plot-ucc.py | py | 35,669 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "scipy.optimize.minimize",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "scipy.optimize",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "scipy.optimize.minimize",
"line_number": 242,
"usage_type": "call"
},
{
"api_name": "... |
210417285 | # ----------------------------------------------------------------------------
# SX Tools - Maya vertex painting toolkit
# (c) 2017-2019 Jani Kahrama / Secret Exit Ltd
# Released under MIT license
# ----------------------------------------------------------------------------
import maya.cmds
import maya.... | null | sxlib/layers.py | layers.py | py | 34,694 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "sxglobals.settings",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "sxglobals.settings",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "maya.cmds.cmds.polyColorSet",
"line_number": 27,
"usage_type": "call"
},
{
"api_n... |
255602462 | """
Basics of reporting capabilities
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... | null | bzt/modules/reporting.py | reporting.py | py | 13,132 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "bzt.engine.Reporter",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "bzt.engine.AggregatorListener",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "time.time... |
191045310 | import random
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.layers import AveragePooling2D, Dropout, Flatten, Dense, Input
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from tensor... | null | face_detector.py | face_detector.py | py | 2,746 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
312527298 | import boto3
import json
import os
from botocore.vendored import requests
import string
def lambda_handler(event, context):
client = boto3.client('mediatailor')
print ("mediatailor event: " + json.dumps(event))
# get environment variables
configName = os.environ['ConfigName']
videoSource = os.env... | null | CloudFormation/BasicConfiguration/emtconfig.py | emtconfig.py | py | 3,847 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "boto3.client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number"... |
142850835 | #! /usr/bin/python3.6
import ccxt
import os
import datetime
# get the tickers
def get_tickers():
return(cryptopia.fetch_tickers(symbols))
def get_cryptopia_object():
cryptopia = ccxt.cryptopia({'apiKey': '8d5e6e4aef1243b799acb10c9f46c42f',
'secret': 'cR338hM7vKZXIU3kgY88eDl... | null | gatherData.py | gatherData.py | py | 1,151 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "ccxt.cryptopia",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_... |
333357848 | """
This script is used to produce all the plots and analysis for recovery tracking section's Disaster mapping portion.
This script is specifically focused on recovery mapping and analysis post March 26, 2015.
@zeal
"""
from shapely.geometry import Point, Polygon
import pandas as pd
import geopandas as gpd
import numpy... | null | scripts/tracking_recovery.py | tracking_recovery.py | py | 43,282 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.to_datetime",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.offsets.Week",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pandas.offsets",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "pandas.mer... |
340773599 | import pandas as pd
import numpy as np
import sys
import numpy
import math
import networkx as nx
import matplotlib.pyplot as plt
numpy.set_printoptions(threshold=sys.maxsize)
from nltk.stem import PorterStemmer
from nltk.tokenize import sent_tokenize, word_tokenize
from scipy.special import xlogy
import operator
#####... | null | 4_Neural Network/Part1.py | Part1.py | py | 10,221 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.maxsize",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFram... |
294050257 | from typing import List, Union, Dict, Tuple, Any, Deque
from enum import Enum, auto
from dataclasses import dataclass
from collections import deque
from type import Type
from tokenizer import TK, Token
from utils import debug, warning
TYPES = '.func', 'void', 'char', 'short', 'int', 'long', 'long long', 'float', 'do... | null | parser/parseutils.py | parseutils.py | py | 8,792 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "enum.Enum",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "enum.auto",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "enum.auto",
"line_number": 26,
... |
475983805 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import numpy
from matplotlib import pyplot as plt
def parseNEC(filename):
theta = []
phi = []
amp = []
fh = open(filename, 'r')
while True:
line = fh.readline()
if line.find('EXCITATION') != -1:
junk = fh.readline()
toUse = fh.readl... | null | antenna_sims/leda_nec4/compare74.py | compare74.py | py | 3,955 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.array",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "numpy.pi",
"line_number": 45,... |
296250004 | import unittest
import os
import json
from app import create_app, db
from app.models import Plant, GardenPlant, Garden
from datetime import timedelta
import datetime
class ModelTestCase(unittest.TestCase):
"""Model tests."""
def setUp(self):
"""Define test variables and initialize app."""
sel... | null | tests/test_models.py | test_models.py | py | 8,834 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "app.create_app",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "app.db.create_all",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "app.db",
... |
492028835 | # Copyright 2014 MadeiraCloud LTD.
import re
from setuptools import setup, find_packages
try:
import multiprocessing # noqa
except ImportError:
pass
file_text = open('visualops/__init__.py').read()
def grep(attrname):
pattern = r"{0}\W*=\W*'([^']+)'".format(attrname)
strval, = re.findall(pattern, f... | null | setup.py | setup.py | py | 2,032 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.findall",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 26,
"usage_type": "call"
}
] |
44366238 | import logging
from websocket_server import WebsocketServer
import json
import threading
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter(' %(module)s - %(asctime)s - %(levelname)s - %(message)s'))
logger.addHandler(handler)
... | null | main.py | main.py | py | 2,367 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.StreamHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.Format... |
309116999 | from binary_tree.binary_search_tree import BinarySearchTree
from binary_tree.binary_tree import Node
import pytest
def test_add_to_root():
# loop to add
# check items
bst = BinarySearchTree()
bst.add(7)
assert bst.root.value == 7
assert bst.root.right == None
def test_add_multiple():
bst ... | null | class-16/code_review/binary-tree/tests/test_binary_search_tree.py | test_binary_search_tree.py | py | 1,359 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "binary_tree.binary_search_tree.BinarySearchTree",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "binary_tree.binary_search_tree.BinarySearchTree",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pytest.mark.skip",
"line_number": 24,
"usa... |
644289740 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @File Name: problem_68.py
# @Author: Copyright (c) 2016-09-27 19:57:03 Gillett Hernandez
# @Date: 2016-09-27 19:57:03
# @Last Modified by: Gillett Hernandez
# @Last Modified time: 2016-09-27 20:23:32
from itertools import permutations
class FiveGonRing:
def __i... | null | Python/problem_68.py | problem_68.py | py | 1,272 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "itertools.permutations",
"line_number": 35,
"usage_type": "call"
}
] |
59984989 | import cv2
import numpy as np
img = cv2.imread("../imori.jpg")
H, W, C = img.shape
# bgr
blue = img[:, :, 0].copy()
green = img[:, :, 1].copy()
red = img[:, :, 2].copy()
# Y = 0.2126 R + 0.7152 G + 0.0722 B
out = 0.0722 * blue + 0.7152 * green + 0.2126 * red
out = out.astype(np.uint8)
# Determine threshold of Otsu ... | null | Question_01_10/code/q5.py | q5.py | py | 887 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.where",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number"... |
414917409 | import os
import PIL
from PIL import Image
def getFiles(path, extension):
files = []
for r, _, f in os.walk(path):
for file in f:
if extension in file:
files.append(os.path.join(r, file))
return files
start_width = 496
start_height = 369
factor_width_height = start_wid... | null | Project/Tests/Tensorflow/Spectrogram/ImageResizing.py | ImageResizing.py | py | 709 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "os.walk",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 24... |
366848993 | #!/usr/bin/env python
# Python >= 3.6 required
import re
import argparse
import requests
re_link = re.compile('^<([^>]*)>; rel="([a-z]*)"$')
def get_next_api_url(headers):
api_url = ''
if headers.get('Link', None) is not None:
links = headers.get('Link').split(', ')
for link in links:
... | null | misc/githublicensescan.py | githublicensescan.py | py | 1,582 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "re.compile",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.Session",
"line_number": 45,
"usage_type": "call"
}
] |
158621827 | from os import makedirs
import argparse
import numpy as np
from tomogram_utils.volume_actions.actions import partition_tomogram
from file_actions.readers.hdf import _load_hdf_dataset
parser = argparse.ArgumentParser()
parser.add_argument("-raw", "--path_to_raw",
help="path to tomogram to be segmen... | null | runners/dataset_tables/cluster_peaks_particle_peaking/1_partition_tomogram.py | 1_partition_tomogram.py | py | 1,440 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "file_actions.readers.h... |
389960350 | import taichi as ti
import numpy as np
import time
from scipy import sparse
from scipy.sparse.linalg import spsolve
from scipy.sparse.linalg import factorized
ti.init(arch=ti.gpu, default_fp=ti.f64, debug=False)
dim = 2
N = 20 # internal of one edge
W = 10
dt = 1.0/480
dx = 1 / N # 0.05
rho = 1e1
NF = 2 * N * W # 2 ... | null | demo2.py | demo2.py | py | 15,959 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "taichi.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "taichi.gpu",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "taichi.f64",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "taichi.Vector",
"line_nu... |
215423444 | # -*- coding: utf-8 -*-
"""Evaluation script."""
import json
import pickle
from collections import Counter
import click
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.neighbors import KNeighborsClassifier
from tqdm import tqdm
@click.command()
@click.option('-l', '--family-labe... | null | src/ratvec/optimize.py | optimize.py | py | 4,538 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "click.echo",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "click.echo",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 34... |
586976117 | import torch
from torchvision import transforms
import model
# Dataset Store Definitions
train_file = dict()
train_file['DVQA'] = 'DVQA_train_qa_oracle.json'
train_file['FigureQA'] = 'FigureQA_train_qa.json'
val_files = dict()
val_files['DVQA'] = {'val_easy': 'DVQA_val_easy_qa_oracle.json',
'val... | null | configs/config_template.py | config_template.py | py | 3,336 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.Resize",
"line_number": 27,
"usage_type": "call"
},
{
... |
498663472 | import tensorflow as tf
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.metrics import accuracy_score
from tensorflow.contrib.tensorboard.plugins import projector
import os
import shutil
####################### load the mnist data ########################... | null | cnn/mnist/cnn_mnist_custom.py | cnn_mnist_custom.py | py | 5,822 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.StratifiedShuffleSplit",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
49638633 | # 2017/7/?
import cv2
import numpy as np
import math
img = cv2.imread("hoge") # 画像の読み込みと読み込んだ色のタイプを指定
img2 = cv2.imread("hoge") # 画像の読み込みと読み込んだ色のタイプを指定
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # グレースケールにする。
def r(): # 画像サイズを取得し、rangeでint型に変更する。
n = len(img[1])
i = len(img)
return (n, i)
def ... | null | 5-3-2.py | 5-3-2.py | py | 2,594 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2GRAY",
"line_number... |
602161493 | import json
import os
from subprocess import Popen
jfile = open("C:\\gamedev\\PlatformerMD\\res\\Levels\\LDtk_project\\world_levels.ldtk")
jdata = json.load(jfile)
outputfile = open("C:\\gamedev\\PlatformerMD\\tools\\parseroutput\\world_levels.txt","w")
outputfile.write("RES FILE LINES:\n\n\n\n")
levels = jdata['lev... | null | tools/TDtk_parser.py | TDtk_parser.py | py | 5,886 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "json.load",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 31,
"usage_type": "call"
}
] |
377384528 | """Functions for repairing a wheel."""
import ast
import base64
import hashlib
import itertools
import os
import pathlib
import pprint
import shutil
import tempfile
import typing
import zipfile
from . import patch_dll
from . import dll_list
from . import version
# Template for patching __init__.py so that the vendor... | null | delvewheel/wheel_repair.py | wheel_repair.py | py | 27,872 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "pprint.PrettyPrinter",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "typing.Optional",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "typing... |
402244964 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["multivariate_gaussian_samples", "nd_sort_samples"]
import numpy as np
from scipy.spatial import cKDTree
def multivariate_gaussian_samples(matrix, N, mean=None):
"""
Generate samples from a multidimensional Gaussian with a g... | null | george/utils.py | utils.py | py | 1,436 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "numpy.zeros",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.multivariate_normal",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "scipy.... |
145882743 | from collections import defaultdict
import glob
from html.parser import HTMLParser
from itertools import groupby
import os
import re
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from common import LineYCoords, PageCoords
from page_reader_utils import clean_txt, extract_real_page_num, fix_rea... | null | prototype/page_reader.py | page_reader.py | py | 17,791 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "html.parser.HTMLParser",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "re.compile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "html.parser.HTMLParser.__init__",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "htm... |
140606437 |
import urllib.parse
import logging
import bs4
import WebRequest
from autotriever.modules.SmartFetch import ProcessorBase
class SmartDispatcher(ProcessorBase.ProcessorBase):
log = logging.getLogger("Main.SmartDispatcher")
def __init__(self):
super().__init__()
self.wg = WebRequest.WebGetRobust()
def smart... | null | autotriever/modules/SmartFetch/SmartDispatcher.py | SmartDispatcher.py | py | 4,074 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "autotriever.modules.SmartFetch.ProcessorBase.ProcessorBase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "autotriever.modules.SmartFetch.ProcessorBase",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number":... |
595172930 | from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
from conans.tools import Version
import os, glob
class ZuluOpenJDK(ConanFile):
name = "zulu-openjdk"
url = "https://github.com/conan-io/conan-center-index/"
description = "A OpenJDK distribution"
homepage = "https:... | null | recipes/zulu-openjdk/all/conanfile.py | conanfile.py | py | 3,135 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "conans.ConanFile",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "conans.tools.Version",
... |
261354760 | from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from .forms import BlogForm, CommentForm, HashtagForm
from .models import Blog, Comment, Hashtag
# Create your views here.
# Read
def home(request):
blogs = Blog.objects
hashtags = Hashtag.objects
return rend... | null | blog/views.py | views.py | py | 3,168 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "models.Blog.objects",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "models.Blog",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.Hashtag.objects",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models... |
436034166 | # Copyright 2013 Patrick Moor <patrick@moor.ws>
#
# 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 agr... | null | gletscher/aws/aws_helper.py | aws_helper.py | py | 2,276 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"lin... |
437775959 | from anytree import Node, RenderTree
from anytree.exporter import DotExporter
def get_indentation(line):
content = line.lstrip(' ')
# Split string using version without indentation; First item of result is the indentation itself.
indentation_length = len(line.split(content)[0])
return indentation_lengt... | null | doc/pytesthooks.py | pytesthooks.py | py | 2,865 | python | en | code | null | code-starcoder2 | 83 | [
{
"api_name": "anytree.Node",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "anytree.Node",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "anytree.Node",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "anytree.RenderTree",
"line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.