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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8637454764 | import bpy, os
from . preferences import PreferencesPanel
from . utils import parse_entry_list, split_entry, ASSET_TYPE_OBJECT
class CollectionImageParser:
"""
Parser for PreviewHelper. Parses all supported objects and creates
the collection using the preview images.
data = [as... | black-h0bB1T/object_asset_wizard | preview_parsers.py | preview_parsers.py | py | 2,453 | python | en | code | 45 | github-code | 70 | [
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "preferences.PreferencesPanel.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "preference... |
31797370147 | import os
import sys
path = '/usr/local/mbaproject'
project = '/webMBArepo'
if path not in sys.path:
sys.path.append(path)
sys.path.append(path+project)
os.environ['DJANGO_SETTINGS_MODULE'] = 'webMBArepo.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
| njakimo/webMBArepo | apache/django2.wsgi | django2.wsgi | wsgi | 313 | python | en | code | 3 | github-code | 70 | [
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_... |
41990538733 | #PROGRAMA CONTABLE V1.15
#MIJAIL POTINSKI 19/1/2021
import os
from datetime import datetime
close = False
def fecha():
#toma la fecha del sistema
now = datetime.today()
fecha = now.strftime("%d-%m-%Y")
return(fecha)
def fecha1():
#toma la fecha del sistema
now = datetime.today(... | mapkpo/Libro-diario | LibroDiarioMerceríaV3.py | LibroDiarioMerceríaV3.py | py | 5,256 | python | es | code | 1 | github-code | 70 | [
{
"api_name": "datetime.datetime.today",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dat... |
20448512927 |
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.preprocessing import scale
from sklearn.model_selection import train_test_split
from itertools import combinations
import numpy as np
# Implement one-versus-the rest
def ovr(X,y,C):
ovr_models = []
for i in C:
newy = [... | Oh-Yoojin/Machine-Learning | 05-support_vector_machine/support_vector_machine.py | support_vector_machine.py | py | 3,375 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "sklearn.svm.SVC",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
... |
41308736783 | import matplotlib.pyplot as plt
import matplotlib.axes as ax
import numpy as np
import os
import statistics
# from chebyshev_SEA import chebyshev_SEA as chebyshev
from chebyshev_adwin import chebyshev_adwin as chebyshev
from skmultiflow.drift_detection.adwin import ADWIN
fig, axs = plt.subplots(3)
fig = plt.gcf()
fig.... | thanapol2/data_stream | playground_light/plot_play/plot_benchmark/plot_benchv2.py | plot_benchv2.py | py | 4,219 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.gcf",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ma... |
12508281407 | from django.shortcuts import render, redirect
from django.db.models import Q
from .models import Room, Topic, Message
from .forms import RoomForm, TopicForm, MessageForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from djang... | Zen1400/Data_Science_Portfolio | django_study_rooms/study_rooms/base/views.py | views.py | py | 7,447 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.shortcuts.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 30,
"usage... |
6113427606 | from utils import *
from global_data import *
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.model_selection import cross_val_score
logging.info("Problem f")
gamma = [1000, 100, 10, 1, 0.1, 0.01, 0.001]
method_arr = [TruncatedSVD(n_components=50, n_iter=10, random_state=17),
... | popo0293/EE219Proj1 | f.py | f.py | py | 2,001 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sklearn.pipeline.Pipeline",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.cross_val_score",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.svm.LinearSVC",
"line_number": 33,
"usage_type": "call"
},
... |
43214698462 | from decimal import Decimal
from ubl.models.common.ubl_common_aggregate_components_2_1 import AddressLine
from ubl.models.common.ubl_common_aggregate_components_2_1 import AnticipatedMonetaryTotal
from ubl.models.common.ubl_common_aggregate_components_2_1 import BuyerCustomerParty
from ubl.models.common.ubl_common_aggr... | tefra/xsdata-samples | ubl/samples/UBL-Order-2.0-Example-International.py | UBL-Order-2.0-Example-International.py | py | 15,581 | python | en | code | 7 | github-code | 70 | [
{
"api_name": "ubl.models.maindoc.ubl_order_2_1.Order",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "ubl.models.common.ubl_common_basic_components_2_1.UblversionId",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "ubl.models.common.ubl_common_basic_componen... |
10946147260 | import torch
import scipy
import numpy as np
def seg2diffgrads(label: np.ndarray) -> np.array:
# input: (y, x) for 2D data or (z, y, x) with z>1 for 3D data
# output: (2, y, x) for 2D data & (2, z, y, x) for 3D data (channel first)
masks = label.squeeze().astype(np.int32)
if masks.ndim==3:
z, ... | zudi-lin/pytorch_connectomics | connectomics/data/utils/data_diffusion.py | data_diffusion.py | py | 5,969 | python | en | code | 151 | github-code | 70 | [
{
"api_name": "numpy.ndarray",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "numpy.int32",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"li... |
71033757986 | from matplotlib import pyplot as plt
import pickle
import numpy as np
from scipy.stats import ttest_rel, ttest_ind
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
import spacy
nlp = spacy.load("en_core_web_lg")
conds = ['intact','lesioned']
#for cond in conds:
if True:
cond = 'Go... | kshabahang/DEN1_GeneralizationAtRetrieval | src/analyze_goodman.py | analyze_goodman.py | py | 3,008 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "spacy.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 2... |
26010835828 | """REST client handling, including HubspotStream base class."""
from __future__ import annotations
import sys
from typing import Any, Callable
import requests
from singer_sdk.pagination import BaseAPIPaginator
from singer_sdk.streams import RESTStream
from singer_sdk import typing as th
if sys.version_info >= (3, 8... | MeltanoLabs/tap-hubspot | tap_hubspot/client.py | client.py | py | 5,752 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sys.version_info",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "typing.Callable",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "requests.PreparedRequest",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "s... |
37351397080 | from threading import Thread
from queue import Queue
from logging import basicConfig, info, INFO
from time import sleep
from random import randint
LOG_FORMAT = '%(asctime)s %(threadName)-17s %(levelname)-8s %(message)s'
basicConfig(level=INFO, format=LOG_FORMAT)
class Producer(Thread):
def __init__(self, queue, *arg... | BioWar/Python-Parallel-Programming | Chapter_2/threading_with_queue.py | threading_with_queue.py | py | 1,147 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "threading.Thread",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "random.randint",
... |
19479349127 | import sys
import os
import json
sys.path.append(os.getcwd() + "/..")
from testslide import TestCase
from map.map import GLOBAL_MAP, Coordinate, Map
from communication.packet import Packet
class TestMap(TestCase):
def setUp(self):
super().setUp()
self.map = Map()
self.packet1 = Packet(... | ayman3010/Drone-exploration | server/src/test/test_map.py | test_map.py | py | 1,542 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "testslide.TestCase",
"line_n... |
30513903816 | from django.db import models, transaction, connection
from cryptography.fernet import Fernet
from django.conf import settings
from django.http import *
# To encrypt or decrypt data
from django.forms import model_to_dict
from office_app.models import *
import json
security = Fernet(settings.ENCRYPT_KEY)
class PAF(m... | fangzening/IntellgentOffice | smart_hr/models.py | models.py | py | 10,932 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "cryptography.fernet.Fernet",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.ENCRYPT_KEY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 12,
"usage_type": "name"
},
{
... |
15624861514 | import gym
from collections import deque
import numpy as np
class NstepWrapper(gym.Wrapper):
def __init__(self, env, nstep, gamma):
super(NstepWrapper, self).__init__(env)
self.env = env
self.nstep = nstep
self.gamma = gamma
# nstep
self.reset_buffer()
# multiplier
self.discount_multiplier = np.arr... | robintyh1/nstep-sil | nstep_wrapper.py | nstep_wrapper.py | py | 1,262 | python | en | code | 11 | github-code | 71 | [
{
"api_name": "gym.Wrapper",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.deque",
... |
21551864946 | import logging
import subprocess as sp
from pathlib import Path
from typing import Sequence
import bakta.config as cfg
import bakta.constants as bc
import bakta.features.orf as orf
log = logging.getLogger('EXPERT-AMRFINDER')
def search(cdss: Sequence[dict], cds_fasta_path: Path):
"""Conduct expert CDS analysi... | oschwengers/bakta | bakta/expert/amrfinder.py | amrfinder.py | py | 3,640 | python | en | code | 356 | github-code | 71 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Sequence",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "bakta.config.tmp_path.... |
21268971094 | import argparse
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import misc
from evaluation import eval_submission
from evaluation import parse_data
plt.rcParams['font.sans-serif'] = ['SimSun'] # 中文字体设置-黑体
plt.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题
sns.set(font='SimSu... | Mr-Talon/Trustworthy-AD | Trustworthy_AD/plot.py | plot.py | py | 12,246 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 11,
"usage_type": "attribute"
},
{
... |
38452793229 | '''
PYTHON CODE TO TEST THE TRAINED KERAS MODEL
'''
# import the necessary packages
from keras.preprocessing.image import img_to_array
from keras.models import load_model
import numpy as np
import imutils
import cv2
# load the image
image = cv2.imread('M:\\Tericsoft\\Teric_Research\\keras-data-augmentation\... | ashish-AIML/image_classification_augmentation_combine_keras | test.py | test.py | py | 1,212 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.imread",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "keras.preprocessing.image.img_to_array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.ex... |
70811994471 | import asyncio
from async_firmata.const import *
class Protocol(asyncio.Protocol):
"""asyncio Protocol responsible for data transport"""
_connected: asyncio.Event
_buffer: bytearray
transport: asyncio.Transport
def __init__(self, board) -> None:
self.board = board
self.loop = boa... | lennart-k/python-async-firmata | async_firmata/protocol.py | protocol.py | py | 2,212 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "asyncio.Protocol",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "asyncio.Event",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "asyncio.Transport",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "asyncio... |
30923445639 | from django.shortcuts import render, redirect
from .jsonbase import JsonBase
from .models import Document
from .vision import vision
from django.contrib import messages
import os
import json
import cv2
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
from .visio... | RockhoRockho/FG_Vision | VISION/views.py | views.py | py | 6,612 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "pytesseract.pytesseract",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 31,
"usage_type": "call"
},
{
"api_... |
72838397670 | from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/process_data', methods=['POST'])
def process_data():
data = request.json
result = {'message': 'Dados recebidos com sucesso!', 'data'... | Tiago65133/HTML-BACKEND | app.py | app.py | py | 412 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "flask.request... |
19068144910 | # 7 Even Odd Series. Given a string and it contains the digits as well as non-digits. We have to find the largest even number
# from available digits after removing the duplicates. If not possible, print -1.
from itertools import permutations as perm
def even_no(ar):
return ["".join(str(j) for j in i) for i in li... | SaiSudhaV/TrainingPractice | ArraysI/odd_series.py | odd_series.py | py | 534 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "itertools.permutations",
"line_number": 7,
"usage_type": "call"
}
] |
39999131838 | # function to scrape top ten news stories from bbc.com
import requests
from bs4 import BeautifulSoup
url = 'http://www.bbc.com/news'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
top_stories = soup.find_all('a', class_='gs-c-promo-heading')
for story in top_stories:
print(story.text)
| pilipb/Portfolio | Recipes/RecipeSuggest/test.py | test.py | py | 316 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 9,
"usage_type": "call"
}
] |
40613452517 | import numpy as np
import json
with open("data.json") as f:
data = np.array(json.load(f))
trees = 0
for i, d in enumerate(data):
if d[i * 3 % len(d)] == '#':
trees += 1
print(trees)
| mxgordon/advent_of_code | 2020/day03/part1.py | part1.py | py | 202 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.array",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 5,
"usage_type": "call"
}
] |
37364201425 | import nltk
from tqdm import tqdm_notebook as tqdm
import pickle
import os
import spacy
import nltk
import pandas as pd
from tqdm import tqdm
from sarvam.colorful_logger import *
# Find how often each Category used each word
# import en_core_web_lg
# nlp = spacy.load('en_core_web_sm')
def tokenize(df: pd.DataFrame, ... | dhiraa/sarvam | src/sarvam/nlp/spacy.py | spacy.py | py | 3,298 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "tqdm.tqdm",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.sto... |
36064035658 | from django.urls import path
from django.views.generic import TemplateView
from .views import TestCaseView, TestStepDetail, TestStepStats
app_name = "testcase"
urlpatterns = [
path("", TemplateView.as_view(template_name="testcase/tchome.html"), name="tchome"),
# path("success/", TemplateView.as_view(template_... | Amitabh1989/Django-JS-Tailwind-ProjectShadow | mysite/testcase/urls_NON_API_ROUTING.py | urls_NON_API_ROUTING.py | py | 602 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.views.generic.TemplateView.as_view",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.views.generic.TemplateView",
"line_number": 8,
"usage_type": "name"
},
... |
10481057062 | import re
from django.db import models
from django.urls import reverse
from django_extensions.db.fields import AutoSlugField
from easy_thumbnails.files import get_thumbnailer
class GlobalTags(models.Model):
tags = models.TextField(
blank=True,
null=True,
help_text='Tags to be added to eve... | orangespaceman/tanmt | tanmt/pictures/models.py | models.py | py | 4,606 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "django.db.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.db.models.TextField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
39218273167 | from collections import Counter
from data_tools.connection_init import acc, act, acu
from data_tools.functions import is_all_properties_available
from docx import Document
import ifcopenshell
from uuid import UUID
precision = 1
needed_properties = ['Zone_ZoneName', 'Zone_NetArea', ['Dane pomieszczenia', 'Kolor ścian'... | Marcin-Ramotowski/Archicad-API-Scripts | scripts/file_scripts/room_report.py | room_report.py | py | 4,572 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "data_tools.connection_init.acc.GetAllPropertyNames",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "data_tools.connection_init.acc",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "data_tools.functions.is_all_properties_available",
"line_nu... |
17838088665 | from flask import Flask, request
from flask_cors import CORS
from keras.models import load_model
import tensorflow as tf
import numpy as np
app = Flask(__name__)
CORS(app)
@app.route('/', methods=['POST'])
def hello():
model = load_model("model.h5")
data = request.get_json()
data = np.array(data, dtype=n... | OrestProgrammer/PredictingLengthofStayatHospitals | app.py | app.py | py | 515 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_j... |
5792497313 | import random
import pyasge
from game.pathfinding import resolve
from game.catdata import CatType
from enum import IntEnum
class NodeType(IntEnum):
SELECTOR = 1
SEQUENCE = 2
DECORATOR = 3
LEAF = 4
ROOT = 5
class BehaviourTreeRodent:
def __init__(self, data, rodent, cats):
# Last bran... | Shawwal00/TDCat-Group-Game | game/behaviourtree.py | behaviourtree.py | py | 15,398 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "enum.IntEnum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pyasge.GameTime",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "pyasge.GameTime",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "pyasge.GameTime... |
8594355529 | import matplotlib.image as mpimg
import os
from os import walk
import matplotlib.pyplot as plt
import numpy as np
import cv2
import pickle
import glob
import time
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from multiprocessing import cpu_count
from functools import partial
from m... | harshnandan/CarNd_t1_p5_object_detection | src/train_car_model_single.py | train_car_model_single.py | py | 14,899 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.cvtColor",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "cv2.cvtColor",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2LUV",
... |
43031689855 | import pytesseract
import sys
import argparse
import requests
from bs4 import BeautifulSoup
import datetime
import random
import os
try:
import Image
except ImportError:
from PIL import Image
from subprocess import check_output
def resolve(path):
print("Resampling the Image")
samples = [100,200,300,40... | thesivis/theisbn | captcha.py | captcha.py | py | 4,592 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "random.getrandbits",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pytesseract.image_to_string",
"line_number": 23,
"usage_type": "call"
},
{
"api_name":... |
35956271570 | from collections import namedtuple
Category = namedtuple("Category", ["id", "name", "parent"])
class Expense(object):
def __init__(self, id, user_id, year, month, day, week, description, category, cost):
self.id = id
self.user_id = user_id
self.year = year
self.month = month
... | nlindblad/splitwise-openexchangerates-python-client | splitwise/model.py | model.py | py | 709 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "collections.namedtuple",
"line_number": 3,
"usage_type": "call"
}
] |
1461712932 | from flask import Blueprint, jsonify
api = Blueprint("api",__name__)
data = [
{
"id" : 1,
"name" : "stone"
},
{
"id" : 2,
"name" : "fish"
},
{
"id" : 3,
"name" : "vegetables"
},
{
"id" : 4,
"name" : "beans"
},
{
... | Fioiyobong/first_heroku | api/routes.py | routes.py | py | 900 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"line_number": 33,
"usage_type": "call"
}
] |
17866731634 | import pytest
from pytest import CaptureFixture
from data_structures.binary_tree import AVLTree
class TestBalancedTree:
@pytest.fixture
def avl_tree(self) -> AVLTree:
avl_tree = AVLTree()
avl_tree.insert(16)
avl_tree.insert(8)
avl_tree.insert(20)
avl_tree.insert(4)
avl_tree.insert(12)
... | SunnyHuangCodebase/Data-Structures-and-Algorithms | tests/test_balanced_tree.py | test_balanced_tree.py | py | 4,512 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "data_structures.binary_tree.AVLTree",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "data_structures.binary_tree.AVLTree",
"line_number": 10,
"usage_type": "name"
},... |
20138721957 | import requests
def find_asn(env) :
f = open(f'/archive/_env/{env}', 'r')
for _asn in f.readlines() :
try :
asn = _asn.strip()
url_prefix = f"https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS{asn}"
url_path = f"https://stat.ripe.net/dat... | pora49494/preprocess | app/module/asn.py | asn.py | py | 1,066 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
}
] |
70901071590 | import bpy
##################################################################
path_tox3d='C:/Users/xxx/Documents/blender/'
path_toimage='C:/Users/xxx/Documents/blender/'
filename_ofx3d='projectname_'
filename_ofimage='newimage_'
startframe_ofx3d=0
endframe_ofx3d=10
#################################################... | DaisukeMiyamoto/paraview-scripts | blender/old/import_x3d2.py | import_x3d2.py | py | 4,095 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "bpy.ops.object.add",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "bpy.data",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "bpy.data",
"line_nu... |
35755621782 | from datetime import datetime
from django.conf import settings
import pytest
from freezegun import freeze_time
from olympia import amo
from olympia.amo.tests import addon_factory, user_factory, version_factory
from olympia.constants.promoted import LINE, NOT_PROMOTED, NOTABLE
from olympia.promoted.models import Prom... | mozilla/addons-server | src/olympia/promoted/tests/test_tasks.py | test_tasks.py | py | 5,653 | python | en | code | 844 | github-code | 71 | [
{
"api_name": "olympia.amo.tests.user_factory",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.TASK_USER_ID",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 21,
"usage_type": "name"
},... |
19247059589 | """
template for generating data to fool learners (c) 2016 Tucker Balch
"""
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
# this function should return a dataset (X and Y) that will work
# better for linear regresstion than random trees
def best4LinReg(seed=1489683273):
np.ran... | aten2001/omscs-cs7646 | mc3h1_defeat_learners/gen_data.py | gen_data.py | py | 2,119 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.standard_normal",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nump... |
2192680169 | import logging
import os
from typing import Callable, Dict, List, Tuple
from unittest.mock import Mock, patch
from prometheus_client.core import REGISTRY
from pelorus import AbstractPelorusExporter, utils
def get_number_of_logs(
log_record_tuples: List[Tuple[str, int, str]], level: int
) -> int:
return len(... | dora-metrics/pelorus | exporters/tests/__init__.py | __init__.py | py | 1,921 | python | en | code | 216 | github-code | 71 | [
{
"api_name": "typing.List",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number"... |
40823417783 | import glob
import os
import sys
import process_labels
from PIL import Image
import numpy as np
import concurrent.futures
from pathlib import Path
# convert labels in PRETTY colours (or PRETTY_FILMIC...) to greyscale 8 bits for mmseg
def to_greyscale_labels(png_file, out_folder):
print (png_file)
output_pa... | twak/fast_crop | blender_labels_to_dataset.py | blender_labels_to_dataset.py | py | 2,601 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_n... |
29802826629 | import openai
import tiktoken
import numpy as np
import os
import time
import logging
import re
import utils.langchain_helpers.simple_prompt
from utils import openai_helpers
from utils import redis_helpers
from utils import helpers
from langchain.prompts.chat import (
ChatPromptTemplate,
HumanMessagePro... | samelhousseini/km-openai | utils/langchain_helpers/oldschoolsearch.py | oldschoolsearch.py | py | 4,999 | python | en | code | 50 | github-code | 71 | [
{
"api_name": "utils.redis_helpers.get_new_conn",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "utils.redis_helpers",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "utils.openai_helpers.get_encoder",
"line_number": 69,
"usage_type": "call"
},
{
... |
29753876786 | import pandas as pd
import os
import pickle
from nltk import bigrams
from nltk.stem.lancaster import LancasterStemmer
from nltk import pos_tag
"""
Implementation Notes
This script finds the names of the award winners for a particular ceremony.
It does so by extracting tweets with the action verb "wins" to limit the ... | captainsafia/eecs337-golden-globes | award_winners.py | award_winners.py | py | 3,054 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.read_pickle",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "nltk.bigrams",
"line_number": 48,
"usage_type": "argument"
},
{
"api_name": "nltk.stem.lancaster.LancasterStemmer",
"line_number": 49,
"usage_type": "call"
},
{
"api_name... |
25363511563 | """Tasks done in background by Rq.
This file must NOT be imported by app.py, or by any import thereof, because it will cause
a cyclic import.
The functions within are referred with qualified "Python paths"
(eg., "flask_app.modeling.tasks.do_classifier_related_task"). Rq supports that.
"""
import logging
import typing... | dnaaun/openFraming | services/web/backend/flask_app/modeling/tasks.py | tasks.py | py | 6,073 | python | en | code | 7 | github-code | 71 | [
{
"api_name": "logging.basicConfig",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "typing.Union... |
13413842920 | import inspect, os
import xml.etree.ElementTree as ET
routeName = "blackdiamond"
filePrefix = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + "/" + routeName # name of input and output file
smallCut = 15 # number of seconds between each reading is small output file
fileTracked = filePrefix... | fleet-pond/fleet-pond-app | routes/tcxToCsv.py | tcxToCsv.py | py | 1,868 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "inspect.getfile",
"line... |
42352416287 | """
Plot bulk fluxes as a time series, including all chemical tracers
if present.
"""
import matplotlib.pyplot as plt
import numpy as np
import pickle
from lo_tools import Lfun, zfun
from lo_tools import plotting_functions as pfun
import tef_fun
import flux_fun
Ldir = Lfun.Lstart()
in_dir00 = Ldir['LOo'] / 'extract... | parkermac/LO | extract/tef/bulk_plot.py | bulk_plot.py | py | 5,232 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "lo_tools.Lfun.Lstart",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "lo_tools.Lfun",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "lo_tools.Lfun.choose_item",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lo_tools... |
4298538509 | # ======== IMPORTS =====================================================================================================================
import sys, getopt, cherrypy, json, os, argparse
import importlib.util
from cherrypy.lib import sessions
import logging
# logging.basicConfig(filename="main_logfile.log", filemode="... | WilcoBreedt/Angular-Cherrypy | backend/server.py | server.py | py | 7,587 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "cherrypy.response",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "cherrypy.r... |
30485979025 | import base64
import datetime
import io
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import plotly.express as px
import plotly.graph_objects as go
import seismic as sei
import pandas as pd
df1 = pd.DataFrame()... | GuillaumeGatti/MOM_GEO_2020 | back.py | back.py | py | 6,834 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "base64.b64decode",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "io.StringIO",
"... |
409158879 | import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from sklearn.metrics import silhouette_score, silhouette_samples
from sklearn.metrics import adjusted_rand_score
from sklearn.metrics.cluster import contingency_matrix
from sklearn.metrics import davies_bouldin_score
from sklearn.metrics i... | gusseppe/master_artificial_intelligence | Introduction_to_Machine_Learning/deliverables/iml/cluster/metrics.py | metrics.py | py | 8,559 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "sklearn.cluster.AgglomerativeClustering",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "cluster.kmeans.KMeans",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cluster.kmodes.KModes",
"line_number": 38,
"usage_type": "call"
},
{
... |
18273860518 | from rest_framework import status, viewsets, mixins, permissions
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.decorators import action
from rest_framework import renderers
from Core.Models.models.currencyrate ... | trulander/exchange-rates | exchangerates/api/views.py | views.py | py | 3,114 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "rest_framework.response.Response",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 18,
"usage_type": "call"
... |
42210774523 | import unittest,subprocess,os,wsgikit,signal,time,json,urllib
from urllib.request import urlopen
from urllib.request import Request
import mimetypes
def encode_multipart_formdata( fields = None, files = None):
"""
fields is a sequence of (name, value) elements for regular form fields.
files is a sequence of (... | Mikhus/wsgikit | tests/testsuite.py | testsuite.py | py | 6,046 | python | en | code | 8 | github-code | 71 | [
{
"api_name": "mimetypes.guess_type",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
12811966179 | from base.views import supplier_views as views
from django.urls import path
urlpatterns = [
path('', views.getSuppliers, name='suppliers'),
path('upload/', views.uploadImage, name='image-upload'),
path('<str:pk>/', views.getSupplier, name='supplier'),
path('<str:pk>/reviews/', views.createSupplierRevie... | jacoblimjy/HawkHub-Software-Engineering-Project | backend/base/urls/supplier_urls.py | supplier_urls.py | py | 603 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "base.views.supplier_views.getSuppliers",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "base.views.supplier_views",
"line_number": 5,
"usage_type": "name"
},
{
... |
4322506408 | """
Python class that handles vehicle detection. It has two modes
Full Scan: This is during initialization when all of the lanes and all positions, 224 in a four-lane highway,
are used in the sliding window before Voxel Occlusion constraint propagation technique is applied.
Sentinel Scan: This is for video after full ... | stevenwudi/CarND-Vehicle-Detection | lib/vehicleDetection.py | vehicleDetection.py | py | 15,446 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "time.strftime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "lib.maskRCNN.maskRCNN",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"lin... |
5645294978 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 6 10:26:16 2020
@author: bencohen
"""
import numpy as np
import skimage
from skimage.color import rgb2gray
from skimage.io import imread
import matplotlib.pyplot as plt
import os
# allow for device input, comment out to use shortcut
#directory = i... | bcohen479/ML-Breat_Cancer_Classfier | scripts/image_contrast_graph.py | image_contrast_graph.py | py | 940 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.chdir",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "skimage.color.rgb2gray",
"li... |
10448201287 | from os import listdir
from os.path import isfile, join
import argparse
def get_file_names(folderpath,out='output.txt', write_or_abend='w'):
""" takes a path to a folder and writes all filenames in the folder to a specified output file"""
# Make a list of files & dirs and then remove everything that is not a f... | JonasRex/JupyterLab_My_Notebooks | my_modules/ex2/utils.py | utils.py | py | 3,057 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.listdir",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 3... |
337115366 | import django.views.generic.base as base
import django.http as http
import text_speech.forms as forms
import text_speech.amazon_polly as amazon_polly
import os
class text_speech(base.TemplateView):
template_name = "text_speech/index.html"
def get_context_data(self, **kwargs):
context = super().get_con... | JackOfSpade/jackwu_ca | text_speech/views.py | views.py | py | 1,078 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "django.views.generic.base.TemplateView",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.views.generic.base",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "text_speech.forms.input_form",
"line_number": 12,
"usage_type": "call... |
29451364661 | from flask import abort, make_response
from config import db
from models import Person, person_schema, people_schema
def create(person):
""" Creates a new person in the people structure """
lname = person.get("lname")
existing_person = Person.query.filter(Person.lname == lname).one_or_none()
if exis... | ammfat/peanotes | people.py | people.py | py | 2,086 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "models.Person.query.filter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "models.Person.query",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "models.Person",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "mod... |
1136599584 | import numpy as np
from soundquilter import quilter as qtr
import pytest
# TODO: how to test houskeeping methods in the app
SHOW = False
PLAY = False
# PATH_TO_REF_ARRAYS = "soundquilter/tests/ref/"
PATH_TO_REF_ARRAYS = "ref/"
def test_split_array():
# should work only when signal size evenly divisible by segme... | fedeadolfi/soundquilter | soundquilter/tests/test_sound_quilter.py | test_sound_quilter.py | py | 4,740 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "numpy.ones",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "soundquilter.quilter.split_array",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "soundquilter.quilter",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "nump... |
1895994577 | #!/usr/bin/env python3
import csv
import json
import itertools
import subprocess
import shutil
import glob
import sys
import multiprocessing
import os
import time
import requests
import partridge as ptg
import shelve
from multiprocessing import Pool
from os.path import basename
import parse_gtfs
def get_script_pa... | nickolasclarke/dispatch | src/pull_gtfs.py | pull_gtfs.py | py | 13,494 | python | en | code | 2 | github-code | 70 | [
{
"api_name": "os.path.abspath",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "os.path.split",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
30491426173 | import datetime
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.management import BaseCommand
from django.db import IntegrityError
from education.models import Role, UserProfile
from rapidsms.contrib.locations.models import Location, LocationType
from poll.model... | unicefuganda/edtrac | edtrac_project/rapidsms_edtrac/education/management/commands/initialize_database.py | initialize_database.py | py | 2,559 | python | en | code | 7 | github-code | 70 | [
{
"api_name": "django.core.management.BaseCommand",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "education.models.Role.objects.get_or_create",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "education.models.Role.objects",
"line_number": 14,
"usage_... |
13785668148 | # 파이썬 실습 파일: 2-3.ECC(Group).py
import math
import numpy as np
import matplotlib.pyplot as plt
# Additive Operation
def addOperation(a, b, p, q, m):
if q == (math.inf, math.inf):
return p
x1 = p[0]
y1 = p[1]
x2 = q[0]
y2 = q[1]
if p == q:
# Doubling
# slope (s) ... | wikibook/blockchain-by-python | 2-3.ECC(Group).py | 2-3.ECC(Group).py | py | 1,469 | python | ko | code | 12 | github-code | 70 | [
{
"api_name": "math.inf",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",... |
40556244101 | import os ,django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
django.setup()
from faker import Faker
from product.models import Brand ,Product
import random
from random import randint
fake = Faker()
def seed_brand(n):
for _ in range(n):
image=['1.png', '2.png', '3.png', '4.png', '... | AhmedTarek111/Greeny | dummy_data.py | dummy_data.py | py | 1,307 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.environ.setdefault",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "django.setup",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "faker.Faker",
"li... |
35591814287 | from functools import reduce
from django.db.models import Q
from django.shortcuts import render, redirect
from django.contrib import messages
from django.http import JsonResponse
from django.contrib.auth.models import User
from django.db import connection
from core.exceptions import NoResultsError, PrivateProfileErro... | ah8ad3/FIFA-Tracker | FIFATracker/teams/views.py | views.py | py | 2,554 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "functools.reduce",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.db.models.Q",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "players.models.DataUsersTeams.objects.for_user",
"line_number": 34,
"usage_type": "call"
},
{
... |
37086571890 | '''
Problem: Collections.deque().
Description: Perform the given commands
on a deque, e.g. append(), pop(),
popleft(), appendleft().
Points: 20.
'''
from collections import deque
def perform_cmd(d, command):
command = command.split()
if command[0] == 'append':
d.append(int(command[1]))
elif comma... | Ersain/hackerrank | Solve Python/Collection/Deque/Deque.py | Deque.py | py | 720 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "collections.deque",
"line_number": 25,
"usage_type": "call"
}
] |
24185929142 | import numpy as np
import pandas as pd
from scipy import sparse as ssp
import os
import glob
import math
import pickle
import datetime
from sklearn.preprocessing import LabelEncoder,OneHotEncoder,LabelBinarizer
from sklearn.ensemble import RandomForestRegressor
from sklearn.utils import resample
from sklearn.decomposit... | qqgeogor/RecomendationDL | xgb_w2v.py | xgb_w2v.py | py | 3,587 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "numpy.random.seed",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "scipy.sparse.csr_matrix",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "scipy.spa... |
38718734787 | """
Вспомогательные функции.
"""
# стандартная библиотека
from configparser import ConfigParser
from shutil import get_terminal_size
from typing import Literal
# проект
import bot
import data
def read_players() -> bool:
"""Читает файл данных игроков, сохраняет информацию в соответствующую глобальную структуру да... | TOP-Python321/_reference_project1 | src/utils.py | utils.py | py | 10,003 | python | ru | code | 0 | github-code | 71 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "data.PLAYERS_PATH",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "data.players_db",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": ... |
26720554777 | import cv2
import numpy as np
import xml.etree.ElementTree as ET
def simple_show_mask(mask):
'''
简单显示mask
:param mask:
:return:
'''
_, mask_binary = cv2.threshold(mask, 0, 255, cv2.THRESH_BINARY)
return mask_binary
def draw_mask_in_img(image, mask, draw_boundingRect=True,
d... | tdf1995/python_code | retoo_api/test/segmentation/segmentation_assist.py | segmentation_assist.py | py | 5,209 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "cv2.threshold",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_BINARY",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_NEAREST",
... |
40569941732 | import cv2
import math
import os
from src.const_spec import *
from ext import cut_detector as cd
def video2img(file, output_directory, resize=None, get_frame=0.0, unit='select', distinguish=False,
min_frames=0, verbose=True):
# Creating a new directory if not exists
if not os.path.exists(outpu... | vyskocj/TV-News-Scene-Recognition | src/video_capture.py | video_capture.py | py | 5,511 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "os.path.exists",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": ... |
6393018221 | from websockets.sync.client import connect
import json
import time
from kafka import KafkaConsumer
if __name__ == '__main__':
consumer = KafkaConsumer("bitcoin", auto_offset_reset='earliest',
bootstrap_servers=['localhost:9092'], api_version=(0, 10), consumer_timeout_ms=1000)
max... | dvzadara/kafka-lab | consumer.py | consumer.py | py | 752 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "kafka.KafkaConsumer",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 15,
"usage_type": "call"
}
] |
27245817591 | from utils.log import log
class Question:
def __init__(self, db, event_handler):
"""
Handles questions posted to the Ubik platform.
:param db: object for Postgres database.
"""
self.db = db
self.cur = db.get_cursor()
self.event_handler = event_handler
... | gitter-badger/Ubik | modules/src/question.py | question.py | py | 2,177 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "utils.log.log",
"line_number": 60,
"usage_type": "call"
}
] |
25218084678 | import requests,re,time,json
url = 'https://a.sendbp.com/redui/article/188705/947202bf3f74'
headers = {
'Cookie': 'JSESSIONID=CBC3F3908BC7809ECDBC6370837FE4D3',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'
}
response = requests.g... | wangdexinpython/test | 解析添加/sendbp.py | sendbp.py | py | 442 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 11,
"usage_type": "call"
}
] |
13500813363 | from cryptography.fernet import Fernet
import random
import glob
import string
"""
The basic encrypt, generation, and decrypt functions are borrowed from the Fernet documentation.
All extra code for this ransomware POC is made by me such as the file creation/deletion of key, the emailing of the key, main.py, et... | FinnSchaefer/Python-Ransomware-POC | main_functions.py | main_functions.py | py | 2,227 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "string.ascii_letters",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "random.choice",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cryptography.fernet.Fernet.generate_key",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
16546520076 | """Functions for generating multilayer and multiplex networks using various network models.
"""
##### Compatibility for Python 2/3
try:
xrange
except NameError:
xrange = range
######
from .net import MultilayerNetwork,MultiplexNetwork
import math,random
def single_layer_conf(net,degs,degstype="distribution"... | bolozna/Multilayer-networks-library | pymnet/models.py | models.py | py | 33,269 | python | en | code | 94 | github-code | 71 | [
{
"api_name": "random.shuffle",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "net.add_node",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "net.add_node",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "random.shuffle",
"line_n... |
21178110970 | # -*- coding: utf-8 -*-
from django.core import exceptions
from django.conf import settings
from django.db.models import fields
class BigAutoField(fields.AutoField):
def db_type(self, connection=None):
for item in settings.DATABASES:
if settings.DATABASES[item]['ENGINE'] == 'django.db.... | rubydhash/webradius | webradius-project/webradius/util.py | util.py | py | 783 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "django.db.models.fields.AutoField",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models.fields",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.DATABASES",
"line_number": 9,
"usage_type": "attribute"... |
36493583016 | import os
import numpy as np
import pandas as pd
from loguru import logger
from sklearn.model_selection import train_test_split
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras import layers
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.pre... | rkhilnani9/data-quality | data_quality/clf_utils.py | clf_utils.py | py | 2,819 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "tensorflow.keras.preprocessing.text.Tokenizer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.sequence.pad_sequences",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.preprocessing.sequence.pad_s... |
18526459515 |
from typing import Dict
import sys
import os
from org.pyut.PyutConstants import PyutConstants
from org.pyut.general.exceptions.PreferencesLocationNotSet import PreferencesLocationNotSet
from org.pyut.preferences.BaseSubPreference import BaseSubPreference
PREFS_NAME_VALUES = Dict[str, str]
class PreferencesCommon... | cjwang/PyUt | src/org/pyut/preferences/PreferencesCommon.py | PreferencesCommon.py | py | 1,617 | python | en | code | null | github-code | 71 | [
{
"api_name": "typing.Dict",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "org.pyut.preferences.BaseSubPreference.BaseSubPreference",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "org.pyut.preferences.BaseSubPreference.BaseSubPreference.init",
"line_nu... |
7624887510 | # importing required libraries
import json
from urllib.request import urlopen
name=input("Please Enter your Name : ")
# create an free account in www.gender-api.com
# account activation will take some time...
# after activation get the authentication key and use it in mykey
mykey="paste your key here"
#url to ... | shaikaneef/GenderDetection | gender_detection.py | gender_detection.py | py | 794 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "urllib.request.urlopen",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
}
] |
35197062161 | import random
import numpy as np
import matplotlib.pyplot as plt
import sys
#參數
learn_rate = 0.2
epoch = 100
accuracy = 0.9
#input data
data = []
sol = []
sol_class = []
#store final solution
best_ac = 0.0
best_w = []
final_ac = 0.0
def data_input(path):
#read file
file_c = False
while(file_c == Fal... | p870613/perceptron | 105502302.py | 105502302.py | py | 9,143 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "ma... |
16567434738 | #!/usr/bin/env python3
from importlib import import_module
import time
import attr
from labgrid.driver import Driver
from labgrid.factory import target_factory
from labgrid.protocol import PowerProtocol
from labgrid.step import step
@target_factory.reg_driver
@attr.s(eq=False)
class ModbusRTUPowerDriver(Driver, Po... | geomatsi/pwr-tests | d1/labgrid/src/modbus.py | modbus.py | py | 1,770 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "labgrid.driver.Driver",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "labgrid.protocol.PowerProtocol",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "attr.ib",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "attr.val... |
35254485535 | import wget
import os
str1 = "https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/"
str2 = "oisst-avhrr-v02r01."
str3 = ".nc"
for year in range(1981, 1982):
for month in range(9, 11):
for day in range(15, 20):
url = str1 + "{}".format(year) + "{:02d}".... | LingwuPro/LingwuPro | wget.py | wget.py | py | 884 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
72236267105 | import argparse
import codecs
import json
import struct
import xml.etree.ElementTree as ElementTree
import os
import zlib
import dicttoxml
import yaml
class NodeType:
Node = 0x00
Boolean = 0x00
Float = 0x01
Int = 0x02
Vector2 = 0x03
Vector3 = 0x04
Vector4 = 0x06
String = 0x07
Act... | zephenryus/botw-tools | extractors/aamp.py | aamp.py | py | 7,707 | python | en | code | 16 | github-code | 70 | [
{
"api_name": "os.path.basename",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line... |
42352424357 | """
Extract fields at a number of sections which may be used later for TEF analysis
of transport and other properties, making use of multiple subprocesses
to speed up operation. It also runs the process_sections.py and bulk_calc.py jobs
unless you use -test True. You need to run for at least three days to get any
res... | parkermac/LO | extract/tef/extract_sections.py | extract_sections.py | py | 5,994 | python | en | code | 9 | github-code | 71 | [
{
"api_name": "lo_tools.extract_argfun.intro",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lo_tools.extract_argfun",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "importlib.reload",
"line_number": 30,
"usage_type": "call"
},
{
"api_name":... |
71002473510 | import os
import re
import shutil
import signal
import sys
import textract
from tempfile import mkstemp
from pathlib import Path
from prompt_toolkit import prompt
from prompt_toolkit.validation import Validator, ValidationError
from prompt_toolkit.completion import WordCompleter
TestCompleter = WordCompleter(['aa', 'z... | gbirke/sort_scans | sort_scans.py | sort_scans.py | py | 2,083 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "prompt_toolkit.completion.WordCompleter",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pat... |
37161770946 | from unittest.mock import Mock
import pytest
from libpythonprodaanrod.spam.main import EnviadorDeSpam
from libpythonprodaanrod.spam.modelos import Usuario
@pytest.mark.parametrize(
'usuarios',
[
[
Usuario(nome='Danilo', email='daanrod93@gmail.com'),
Usuario(nome='Joyce', emai... | daanrod/libpythonprodaanrod | libpythonprodaanrod/tests/test_spam/test_envio_para_base_de_usuarios.py | test_envio_para_base_de_usuarios.py | py | 1,298 | python | es | code | 0 | github-code | 71 | [
{
"api_name": "unittest.mock.Mock",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "libpythonprodaanrod.spam.main.EnviadorDeSpam",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "call"
},
{... |
5812844329 | import dash
import dash_core_components as dcc
import dash_html_components as html
import dataset as myds
KPI1 = myds.KPI1
KPI2 = myds.KPI2
KPI31 = myds.KPI31 # Product top 1 - name - 2019
KPI32 = myds.KPI32 # Product top 1 - units - 2019
KPI41 = myds.KPI41 # Product top 1 - name - 2019
KPI42 = myds.... | italomarcelogit/scripts-diversos | python-plotly/plotly03.py | plotly03.py | py | 8,150 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "dataset.KPI1",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "dataset.KPI2",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "dataset.KPI31",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "dataset.KPI32",
... |
33686944531 | import itertools
import numpy as np
import math
class Permutation:
def __init__(self,
time_series: np.ndarray,
embedding_order: int = 3,
time_delay: int = 1
):
self.x = time_series
self.order = embedding_order
self.delay =... | najaweed/MT5 | Trader/Strategy/TradingChannels/trading_channels.py | trading_channels.py | py | 4,827 | python | en | code | 2 | github-code | 71 | [
{
"api_name": "numpy.ndarray",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "itertools.permutations",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
... |
9147992408 | import torch
import sklearn
import numpy as np
from elc_metric.ELC import elc
# Metrics
def getPerformance(y_true, y_pred, calc_evt):
# Return all relevant performance metrics
# Do not consider elements with -1
loc = y_true != -1
y_pred = y_pred[loc]
y_true = y_true[loc]
Perf = dict()
Perf... | RSKothari/Gaze-in-Wild | ML/DeepModels/loss.py | loss.py | py | 6,350 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "sklearn.metrics.cohen_kappa_score",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 16,
"usage_type": "call"
},
{
... |
13069200207 | from django.db import models
from rest_framework import serializers
from django.contrib.sites.models import Site
from media.serializers import CustomImageFieldSerializer
from media.models import Photo, Video, Media
class VaultPhotoSerializer(serializers.ModelSerializer):
"""Serializer for photos in ChatVaultView... | richardoyelabi/social-video-django-server | chats/media_vault/serializers.py | serializers.py | py | 2,477 | python | en | code | 3 | github-code | 71 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "media.serializers",
"line_number": 12,
"usage_type": "name"
},... |
40166129549 | from rest_framework import serializers
from ghostpost_app.models import BoastsRoastsModel
# Worked with Sohail and Albina too on the planning/beginning stage before finishing separately
class BoastRoastSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = BoastsRoastsModel
fields... | rtjitradi/ghostpost_backend | ghostpost_app/serializers.py | serializers.py | py | 540 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "rest_framework.serializers.HyperlinkedModelSerializer",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "ghostpost_app.models.BoastsRoastsModel",
"line_number": 8... |
27289946896 | import os
import pygame
from pygame.locals import *
def load_image(file, transparent=True):
# print("Loading " + file + " ..")
fullname = os.path.join("../media", file)
image = pygame.image.load(fullname)
if transparent == True:
image = image.convert()
colorkey = image.get_at((0, 0))
... | HoangNguyenHuu/fuzzy-logic-project | graphic/loader.py | loader.py | py | 432 | python | en | code | 6 | github-code | 71 | [
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_nu... |
24461853126 | import json
import random
def progress(str, i, end):
barLen = 30
print(
f'{str} {i}/{end}\t[{"="*(i*barLen//end)}>{" "*(barLen-i*barLen//end)}]', end='\r')
print('Getting data...')
print('Loading json...')
with open('moves.json', 'r') as f:
json_moves = json.load(f)
print('Creating conv_tables... | JoelVerm/chessJ | chessJGetData.py | chessJGetData.py | py | 2,642 | python | en | code | 0 | github-code | 70 | [
{
"api_name": "json.load",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "random.sample",
"line_numbe... |
23283116651 | import torch
import torch.nn as nn
import torchvision
from torchvision import transforms
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
import string
import cv2
import json
from PIL import Image
import os
import numpy as np
import random
from tqdm import tqdm
import shutil
EPOCHS = 1000
IMAGE... | Espacio-root/shazam-for-food | main.py | main.py | py | 18,032 | python | en | code | 1 | github-code | 70 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
8200719756 | from astropy.table import Table
from helper_functions import luptize_deep_kids
import pandas as pd
import numpy as np
import fitsio
import os
import sys
path = os.path.abspath(sys.path[0])
path_data = f"{path}/../Data/skills_v07D7p1_LF_321_kidsPhotometry_everything_col_flag_shear_m283m283_rot_0.fits"
path_survey_cond... | elmichelangelo/GalaxyFlow | _Old_scripts/_CatalogView.py | _CatalogView.py | py | 3,792 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "os.path.abspath",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "astropy.table.Table",
"li... |
27133883857 | from typing import Dict
from kedro.pipeline import Pipeline
from mridle.pipelines.data_engineering import ris, dicom, dispo
from mridle.pipelines.data_science import harvey, feature_engineering, descriptive_viz, random_forest, xgboost, \
logistic_regression, neural_net, model_comparison, live_data, xgboost_with_li... | uzh-dqbm-cmi/mridle | src/mridle/pipeline_registry.py | pipeline_registry.py | py | 2,440 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "mridle.pipelines.data_engineering.ris.create_pipeline",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "mridle.pipelines.data_engineering.ris",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "mridle.pipelines.data_engineering.dicom.create_pipeli... |
14842356567 | from flask import make_response, redirect, jsonify, render_template, request, url_for, Response
from jots.webapp import app, jwt
class InvalidUsage(Exception):
def __init__(self, message, status_code=400, payload=None):
Exception.__init__(self)
self.message = message
self.status_code = status_code
s... | wilsonc101/jots | webapp/error_handlers.py | error_handlers.py | py | 2,459 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "flask.render_template",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "jots.webapp.app.errorhandler",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "jots.webapp.app",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fl... |
12285850599 | import importlib.util
import sys
spec = importlib.util.spec_from_file_location('mangaupdates', 'mangaupdates/__init__.py')
mangaupdates = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = mangaupdates
spec.loader.exec_module(mangaupdates)
from mangaupdates import Series, ListStats
import csv
import pandas... | aerjayc/mu-api | scripts/list_users.py | list_users.py | py | 8,091 | python | en | code | 0 | github-code | 71 | [
{
"api_name": "importlib.util.util.spec_from_file_location",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "importlib.util.util",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "importlib.util",
"line_number": 3,
"usage_type": "name"
},
{
"... |
8895452609 | import click
from bluebees.client.application.application_data import ApplicationData, app_name_list
from bluebees.client.data_paths import base_dir, app_dir
def validate_name(ctx, param, value):
if not value:
raise click.BadParameter('This option is required')
if not app_name_list() or value not in a... | matheuswhite/bluebees | bluebees/client/application/commands/info.py | info.py | py | 851 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "click.BadParameter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "bluebees.client.application.application_data.app_name_list",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "click.BadParameter",
"line_number": 10,
"usage_type": "call"
... |
4730789320 | from django.db import models
from .address import Address
from .seller import Seller
from .product import Product
from django.db import transaction, IntegrityError
from typing import Optional
from datetime import datetime
class Stock(models.Model):
class Meta:
app_label = 'app'
db_table = 'stock'
... | AngeloMendes/delivery_api | api/app/models/stock.py | stock.py | py | 2,025 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "django.db.models.Model",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.IntegerField",
"line_number": 15,
"usage_type": "call"
},
{
"api_na... |
41800982519 | from __future__ import division
import logbook
import numpy as np
import pandas as pd
from collections import Counter, OrderedDict, defaultdict
from six import iteritems, itervalues
import zipline.protocol as zp
from . position import positiondict
log = logbook.Logger('Performance')
class PerformancePeriod(object... | NeoBert/czipline | zipline/finance/performance/period.py | period.py | py | 12,041 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "logbook.Logger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "position.positiondict",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
... |
17274603545 | # GUI imports
# from cgitb import text
from email import message
import tkinter as tk
from tkinter import Tk, ttk
from tkinter import font
from PIL import Image, ImageTk
# encryptor / decryptor
import arrows
# Global GUI variables (for showing/hiding inputs)
OTP_selected = False
decrypt_selected = False
encrypt_selec... | hunter-c/arrows-encrypt | arrows_gui.py | arrows_gui.py | py | 6,197 | python | en | code | 1 | github-code | 71 | [
{
"api_name": "tkinter.END",
"line_number": 67,
"usage_type": "attribute"
},
{
"api_name": "email.message",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "tkinter.END",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "email.message",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.