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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17996409795 | """
Python script to summarize small and large text
"""
# =====================================================================
# Import
# =====================================================================
# import internal modules
import re
import requests
from typing import List, Set, Dict, TypedDict, Tuple, Opti... | DerrickDDInAI/nlp-text-summarizer | app/summarizer.py | summarizer.py | py | 5,327 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gensim.summarization.summarize",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "app.decorators.timer",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "transformers.AutoTokenizer.from_pretrained",
"line_number": 56,
"usage_type": "call"
... |
43155985078 | # image_segmentation.py
"""Volume 1: Image Segmentation.
Marcelo Leszynski
Math 345 Sec 005
11/06/20
"""
import numpy as np
import math
from scipy import linalg as la
from scipy import sparse
from imageio import imread
from scipy.sparse.linalg import eigsh
from matplotlib import pyplot as plt
# Problem 1
def laplaci... | mleszynski/mathematical-analysis-labs | ImageSegmentation/image_segmentation.py | image_segmentation.py | py | 6,907 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.diag",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.sort",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "numpy.real",
"line_number": 49,
... |
39298291142 | import numpy as np
from PIL import ImageGrab
import cv2
import time
from threading import Thread
class Recorder:
def __init__(self, path:str, length=20, fps=24) -> None:
im = ImageGrab.grab()
self.width, self.high = im.size # 获取屏幕的宽和高
fourcc = cv2.VideoWriter_fourcc(*'avc1') #... | Zplusless/Linux_ScreenRecorder | record_serial.py | record_serial.py | py | 1,298 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PIL.ImageGrab.grab",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "PIL.ImageGrab",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "cv2.VideoWriter_fourcc",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.VideoWrit... |
74711165800 | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split, StratifiedKFold, cross_val_score
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import accuracy_score,... | jdp527/michaelb-homework | analysis.py | analysis.py | py | 2,065 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "sklearn.model_selection.StratifiedKFold",
"line_number": 17,
"usage_type": "call"
},
{
"api_n... |
10489364926 | #!usr/bin/env python
#coding: utf-8
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response,get_object_or_404
from django.core.context_processors import csrf
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.util... | yindashan/neptune | applyonline/views.py | views.py | py | 19,224 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "neptune.settings.DEFAULT_FROM_EMAIL",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "applyonline.models.ApplyOnline.objects.filter",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "applyonline.models.ApplyOnline.objects",
"line_number": 36,... |
14387476033 | # -*- coding: utf-8 -*
######### From Segment Models #########
import segmentation_models as sm
from keras.layers import Input, Conv2D
from tensorflow.keras.optimizers import Adam, RMSprop
from keras.models import Model
if __name__ == "__main__":
import train_utils
else:
from . import train_utils
RESNET_BACK... | foxelas/medHSI | medHSIpy/tools/hsi_segment_from_sm.py | hsi_segment_from_sm.py | py | 3,199 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "segmentation_models.set_framework",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "segmentation_models.framework",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "segmentation_models.get_preprocessing",
"line_number": 25,
"usage_type": ... |
9361794841 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on a windy day, unlike australia
@author: Helen Daly
@id: R00142752
@Cohort: SOFT8032_26756
"""
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import random as rnd
from sklearn import datasets
from sklear... | paudieMola/dataAnalyticsProject3 | SR00142752.py | SR00142752.py | py | 5,585 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 61,
"usage_type": "call"
... |
41105562171 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^update_session/(?P<id_producte>[0-9]+)/$', views.update_session, name='update_session'),
url(r'^update_sessionPost/$', views.update_sessionPost, name='update_sessionPost'... | Andreurp/ProjecteFinal | comandes/urls.py | urls.py | py | 882 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "django.conf.urls.url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.c... |
17741507912 | #!/usr/bin/env python3
import asyncio
import websockets
import json
from types import SimpleNamespace
from pyfirmata import Arduino, util
from time import sleep
board = Arduino("/dev/ttyACM0", baudrate=57600)
#print(board.get_firmata_version())
# #checks generell woking connection
flagIncomingFromVirtual = Fals... | StudioJoHey/ok | _Archiv+Tests/websocketTest.py | websocketTest.py | py | 1,898 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyfirmata.Arduino",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pyfirmata.util.Iterator",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pyfirmata.util",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "time.sleep",... |
36816663823 | # coding=utf-8
from application import bot
from boto3.session import Session
from model.song import Song
import requests
import os
import uuid
import spotipy
humming_mode = False
TOKEN = os.environ.get('BOT_TOKEN')
AUDD_API_TOKEN = os.environ.get('AUDD_API_TOKEN')
SPOTIFY_API_TOKEN = os.environ.get('SPOTIFY_API_TOKE... | RexusWolf/Shazamusic-Bot | application/commands.py | commands.py | py | 5,269 | python | en | code | 16 | github-code | 18 | [
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
22814947517 | # -*- coding: utf-8 -*-
from typing import TYPE_CHECKING, Dict, Optional
from django.db import models
from jsonfield import JSONField
from paas_wl.platform.applications.models import UuidAuditedModel
from paas_wl.utils.models import validate_procfile
if TYPE_CHECKING:
from paas_wl.platform.applications.models.ap... | leafage-collb/bk-paas | workloads/paas_wl/paas_wl/platform/applications/models/release.py | release.py | py | 5,138 | python | en | code | null | github-code | 18 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.db.models.Manager",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "t... |
10292316872 | import websocket
import ssl
import erlang
from Logger import *
from erlang import *
class GatewayServer():
'''
Manages authentication and data transfer to/from http://gateway.discord.gg
'''
URL = "wss://gateway.discord.gg/?encoding=etf&v=6"
class OPCODE:
'''
Taken from https://disc... | tenable/DiscordClient | GatewayServer.py | GatewayServer.py | py | 8,096 | python | en | code | 96 | github-code | 18 | [
{
"api_name": "websocket.WebSocket",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "erlang.term_to_binary",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "Logger.L... |
41285735678 | from urllib2 import Request, urlopen
import json
import datetime
import os
#from V2Authorization import V2Authorization
directory = os.path.dirname(__file__)
# Class deals with API calls
class DataRetriever:
defaultStartDate = datetime.datetime.strptime("2015-01-01 00:00", "%Y-%m-%d %M:%S")
formatTime = date... | SolarNetwork/solarquant | data_retrieval/DataRetriever.py | DataRetriever.py | py | 4,658 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
71426847400 | from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.layers import Dense, Input, LSTM, Embedding, Dropout, Activation, CuDNNGRU, Conv1D
from keras.layers import Bidirectional, GlobalMaxPool1D, CuDNNLSTM
from keras.models ... | aorursy/new-nb-3 | gn53720366_test-quora.py | gn53720366_test-quora.py | py | 5,539 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tqdm.tqdm.pandas",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "re.sub",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 30,
... |
18046376372 | import json
import sys
if len(sys.argv) == 2:
filename = sys.argv[1]
else:
print("Error - please specify one file name with the combined JSON")
with open(filename) as f:
data_json = json.load(f)
def show_tutor_slots(tutor_name):
tutor = [d for d in data_json["tutors"] if d["name"].startswith(tutor_na... | compserv/tutoringlib | tutor_time_viewer.py | tutor_time_viewer.py | py | 836 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 10,
"usage_type": "call"
}
] |
40251489777 | ###################################################
# [Practice] Euler Angles in OpenGL
import glfw
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy as np
from OpenGL.arrays import vbo
import ctypes
gCamAng = 0.
gCamHeight = 1.
alpha = 0.
beta = 0.
gamma = 0.
def drawCube_glVertex():
glBegin(GL_TRI... | hoon4233/Computer-Graphics | LabAssignment9/1/LabAssignment9-1.py | LabAssignment9-1.py | py | 8,255 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.array",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "ctypes.c_void_p",
"line_number": 170,
"usage_type": "call"
},
{
"api_name": "numpy.sin",
"line_number": 186,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number"... |
36354928018 | import random
import statistics
import time
import pygame
import sys
##### PARAMETRES #####
pygame.init()
DIMENSION_FENETRE = (1200, 760)
IPS = 30
NOIR = (0, 0, 0)
VERT = (0, 255, 0)
BLANC = (255, 255, 255)
RED = (255, 0, 0)
fenetre = pygame.display.set_mode(DIMENSION_FENETRE)
pygame.display.set_capt... | KlauseI/Karger-WIP | Main_II.py | Main_II.py | py | 8,720 | python | fr | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "pygame.display... |
74761435241 | import pygame
class Obstaculo(pygame.sprite.Sprite):
def __init__(self,tamaño,color,x,y):
super().__init__()
self.image = pygame.Surface((tamaño,tamaño))
self.image.fill(color)
self.rect = self.image.get_rect(topleft = (x,y))
forma = [ #La figura del obstaculo
" 0000000... | Hamibubu/SpaceInvaders | obstaculo.py | obstaculo.py | py | 423 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.sprite",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",
"line_number": 6,
"usage_type": "call"
}
] |
628446222 | from PySide6.QtCore import QObject, QModelIndex, Qt
from PySide6.QtWidgets import (
QCheckBox, QMenu, QMessageBox, QStyledItemDelegate, QTreeView
)
from PySide6.QtGui import QCursor
import numpy as np
from hexrdgui.hexrd_config import HexrdConfig
from hexrdgui.tree_views.base_tree_item_model import BaseTreeItemMo... | HEXRD/hexrdgui | hexrdgui/cal_tree_view.py | cal_tree_view.py | py | 14,439 | python | en | code | 22 | github-code | 18 | [
{
"api_name": "hexrdgui.tree_views.base_tree_item_model.BaseTreeItemModel.KEY_COL",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "hexrdgui.tree_views.base_tree_item_model.BaseTreeItemModel",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "hexrdgui.tree_... |
12124639960 | from flask import jsonify, request
import json
import pymongo
class UserController:
def __init__(self, user_service):
self.user_service = user_service
def find_all_users(self):
result = self.user_service.find_all_users()
return json.dumps(result, default=str), 200
def create_use... | Thiago-FR/angular-python | backend/app/controller/user_controller.py | user_controller.py | py | 1,711 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.dumps",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "flask.request.json",... |
23136273402 | import torch
import torch.nn as nn
import torch.nn.functional as F
from model import text_feature_propagation, layernorm_gru
class HiAGM(nn.Module):
def __init__(self, config, label_ids):
super(HiAGM, self).__init__()
self.config = config
self.label_ids = label_ids
# TEXT ENCODER ... | brianimpact/air4all | content_classifier/model/hiagm.py | hiagm.py | py | 4,683 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.hub.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.hub",
"line_numb... |
69969827881 | # importando as bibliotecas utilizadas
import gurobipy as gp
import pulp as pu
# definição da classe ModeloGurobi
class ModeloGurobi():
# objeto do tipo gp.Model (modelo matemático do problema)
m = gp.Model("Cobertura")
# posteriormente este atributo será preenchido com as variáveis de decisão do problem... | LePenidon/trabalho_OTM_inteira | etapa_01/code/modelo.py | modelo.py | py | 614 | python | pt | code | 0 | github-code | 18 | [
{
"api_name": "gurobipy.Model",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pulp.LpProblem",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pulp.LpMinimize",
"line_number": 18,
"usage_type": "attribute"
}
] |
20428963342 | import json
import os
import numpy as np
from joblib import Parallel, delayed
from tqdm.auto import tqdm
# List of the supported models to be used with N-gram LM and beam search decoding
SUPPORTED_MODELS = {
'EncDecCTCModelBPE': 'subword',
'EncDecCTCModel': 'char',
}
def softmax(x):
e = np.exp(x - np.ma... | fquirin/speech-recognition-experiments | nvidia-nemo/asr_language_modeling/ngram_lm/kenlm_utils.py | kenlm_utils.py | py | 2,923 | python | en | code | 34 | github-code | 18 | [
{
"api_name": "numpy.exp",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "tqdm.auto.tqdm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 28... |
10167748431 |
import os
import sys
import time
import pymysql
import subprocess
import numpy as np
import pandas as pd
import config
import cplex_data as cdt
import s02_data_transformer as s02
from jinja2 import Environment, FileSystemLoader
# f_handler=open('algorithm_log/p_median.txt', 'w')
# sys.stdout=f_handler
# sys.path.a... | johnlvjinya/lte-admin | prj_m_code/sjtu_pmedian____prj_main/main.py | main.py | py | 11,746 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymysql.connect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "config.host",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.port",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "config.user",
"... |
14812130263 | import requests
from flask import Flask, request, render_template
from answers import qa_model
from chatboot import read_pdf_from_url, download_pdf_from_link
from classes import Paper, Video
app = Flask(__name__)
# pdf_url = "https://cds.cern.ch/record/2863895/files/2307.01612.pdf" # Replace with the actual URL of t... | danyk20/SciFeed | app.py | app.py | py | 3,557 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "flask.request.form... |
1657236642 | import os
import unittest
from dataclasses import asdict
from torchx.components.base.roles import create_torch_dist_role
from torchx.specs.api import Resource, Role, macros
class TorchDistRoleBuilderTest(unittest.TestCase):
def test_build_create_torch_dist_role(self) -> None:
# runs: python -m torch.dist... | SirLegolot/torchx | torchx/components/base/test/roles_test.py | roles_test.py | py | 5,305 | python | en | code | null | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torchx.components.base.roles.create_torch_dist_role",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torchx.specs.api.macros.app_id",
"line_number": 44,
"usage_type... |
38426101508 |
import sys
import uuid
import json
import traceback
from akashic.arules.transpiler import Transpiler
from akashic.util.type_converter import string_to_py_type
from akashic.exceptions import AkashicError, ErrType
from akashic.system.rules.generic_rule import GENERIC_RULE
from akashic.system.rules.query_rule import Q... | Akashic-Projects/akashic | akashic/bridges/data_bridge.py | data_bridge.py | py | 15,691 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.exc_info",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "traceback.print_exc",
... |
11327563452 | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import os
import sys
import re
from sklearn.neighbors import NearestNeighbors
if len(sys.argv) < 2:
print("please specify filename")
sys.exit(-1)
f = sys.argv[1]
df = pd.read_csv(f, header=None if "bhtsne" in f else 0)
dataset = re.search('([^_... | biederfrau/ktsne | scripts/eval_knn.py | eval_knn.py | py | 852 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_numb... |
15516522907 | # coding: utf-8
try:
from unittest import mock
except ImportError:
import mock
from pysuru.http import HttpClient
def test_headers_attribute_should_always_have_authorization_header_with_token():
client = HttpClient('TARGET', 'TOKEN')
assert 'Authorization' in client.headers
assert client.headers[... | rcmachado/pysuru | pysuru/tests/test_http.py | test_http.py | py | 1,256 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pysuru.http.HttpClient",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pysuru.http.HttpClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mock.MagicMock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mock.cal... |
24741261824 | import collections
import math
import pickle
import string
import sys
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# Make a class of inverted index in which all the process is present to find inverted index
class InvertedIndex():
# This is an constructor which wil... | debajyoty/EnIndicSourceCode | sourcecode/sourcecode/hi_index.py | hi_index.py | py | 6,605 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "string.punctuation",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "collections.Counter",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "math.log",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "os.path.isfile"... |
22899287010 | import matplotlib.pyplot as plt
days=[1,2,3,4,5]
sleeping=[7,8,9,12,6]
eating=[2,3,4,3,2]
working=[7,8,7,2,2]
playing=[8,5,7,8,13]
slices = [7,2,2,13]
activities = ['Eating','Working','Playing','Sleeping']
colors= ['c','m','r','m']
plt.pie(
slices,
labels=activities,
colors=colors,
... | ahmedosaka/snippets | Machine learning/sentdex course/Data Visualization/piechart.py | piechart.py | py | 531 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "matplotlib.pyplot.pie",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "matp... |
8641549949 | import matplotlib.pyplot as plt
import csv
# Read data from the CSV file
data = {"mass": [], "sigma_nominal": [], "s_n_error": [], "JER_sigma_up": [], "s_up_error": [], "JER_sigma_down": [], "s_d_error": []}
with open("JER_effect.csv") as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
da... | leyva-daina/MSSM_Htobb-combine | 2018FH_scripts/plotShiftJER.py | plotShiftJER.py | py | 1,387 | python | en | code | null | github-code | 18 | [
{
"api_name": "csv.DictReader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.p... |
26866181590 | #!/usr/bin/env python
import numpy as np
import rospy
from geometry_msgs.msg import PoseArray, Pose, Quaternion
from tf.transformations import quaternion_from_euler
from common import *
if __name__ == '__main__':
rospy.init_node('waypoint_publisher')
# Generate random waypoints
waypoints = np.random.rand(nu... | nrkumar93/ocrl_hw2 | ocrl/scripts/waypoint_publisher.py | waypoint_publisher.py | py | 1,072 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "rospy.init_node",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random.rand",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "rospy.Publisher",... |
6309650894 | from collections import defaultdict
class Solution:
def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool:
dic = defaultdict()
for i in range(len(nums)):
cur = nums[i]
if cur in dic and i - dic[cur] <= k:
return True
dic[cur] = i
... | trajanikant/LeetCode | Python/0219-contains-duplicate-ii.py | 0219-contains-duplicate-ii.py | py | 336 | python | en | code | 54 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
}
] |
40390942240 | # coding=utf-8
import math
import functools
# 场景
class Scene(object):
def __init__(self):
self.__infos = [] # 缓冲的行情(KLine)
self.__ind = {} # 绑定的指标(name : BaseInd)
self.__strategy = [] # 绑定的策略([prio(int), impl])
def update(self, new_info):
# 更新行情
self.__infos.append(new_info)
# 更新绑定的指标
for k,v i... | lxdmp/coin | huobi/scene.py | scene.py | py | 10,296 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "functools.wraps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 276,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": 277,
"usage_type": "call"
},
{
"api_name": "math.fabs",
"line_number": ... |
23244064308 | import argparse
import time
import torch
from torch import nn
import apex
from optimizer.grad_scalar import *
from optimizer.optimizer import Fp16Optimizer
from modules.gpt_modules import GPTTransformerLayer
def benchmark_transformer_layer(args, device):
module_list = []
for _ in range(args.num_layers):
... | FMInference/DejaVu | Decentralized_FM_alpha/unit_tests/micro_benchmark_transformer_layer_amp_optimizer.py | micro_benchmark_transformer_layer_amp_optimizer.py | py | 4,338 | python | en | code | 86 | github-code | 18 | [
{
"api_name": "modules.gpt_modules.GPTTransformerLayer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "... |
33240263019 | from random import choice
from typing import Tuple, List
from model.Battle import Battle
from model.Board import Board
from model.Param import Param
from model.Unit import Unit
from model.UnitFactory import UnitFactory
def generate_unit(round: int) -> Unit:
tank_factory = UnitFactory(attack=Param(low=10, high=20... | zemiret/AGHtochess | mechanics/mechanics.py | mechanics.py | py | 3,782 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "model.UnitFactory.UnitFactory",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.Param.Param",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.Param.Param",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "mod... |
20855088834 | import pymysql
import time
def port_to_data(car_id,station_id):
# 打开数据库连接
db = pymysql.connect ("localhost", "root", "123456", "lightdata")
# 使用cursor()方法获取操作游标
cursor = db.cursor ()
# SQL 插入语句
s = time.strftime ('%Y.%m.%d.%H.%M.%S', time.localtime (time.time ()))
sql = "INSERT INTO car"... | LLion5/TrafficSystem | Python程序/Car/port.py | port.py | py | 706 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pymysql.connect",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_num... |
14187625339 | import datetime
import sqlbuilder.smartsql as sql
class InsertQuery:
def __init__(self, tablename):
self.tablename = tablename
def __call__(self, *args):
stagingtable = sql.T(self.tablename)
query = sql.Q().tables(stagingtable)
kwargs = self.generate_kwargs(*args)
q... | kobergj/AsoiafDWH | Transfer Scripts/ToStaging/QueryGenerators/insertqueries.py | insertqueries.py | py | 1,700 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlbuilder.smartsql.T",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sqlbuilder.smartsql",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "sqlbuilder.smartsql.Q",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sqlbu... |
9256026822 |
import tqdm
import numpy as np
import random
from collections import deque
import pickle5 as pickle
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
class Supervisor :
def __init__(self, game) :
self.game = game
def simulate(self, p1, p2, nb_round,... | Chaminou/Ladder | code/new/morpion/rl_game.py | rl_game.py | py | 12,455 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tqdm.tqdm",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "numpy.int8",
"line_number": 130,
"usage_type": "attribute"
},
{
"api_name": "numpy.argmax",
"line_numb... |
28914802198 | #! /usr/bin/env python3
# coding: utf-8
from __future__ import annotations
import typing as t
import pendulum
from psycopg2.extensions import connection
from gargbot_3000.journey import common
queries = common.queries.achievements
possible = [
{
"query": queries.most_steps_one_day_individual,
... | eirki/gargbot_3000 | gargbot_3000/journey/achievements.py | achievements.py | py | 8,102 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gargbot_3000.journey.common.queries",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "gargbot_3000.journey.common",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 65,
"usage_type": "attribute"
},
... |
25062423782 | import cv2 as cv
'''
视频文件的读、写
'''
# 加载本地视频文件
videoInput = cv.VideoCapture('my-video.avi')
fps = videoInput.get(cv.CAP_PROP_FPS)
size = (int(videoInput.get(cv.CAP_PROP_FRAME_WIDTH)), int(videoInput.get(cv.CAP_PROP_FRAME_HEIGHT)))
# 创建到本地文件的输出
videoWriter = cv.VideoWriter('my-video-copy.avi', cv.VideoWriter_fourcc('I',... | RabbitNoTeeth/opencv | learning_opencv3_with_python/chapter2/c214.py | c214.py | py | 1,301 | python | zh | code | 0 | github-code | 18 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.CAP_PROP_FPS",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.CAP_PROP_FRAME_WIDTH",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "cv... |
7217216471 | import argparse
import torch
import os
from datetime import datetime
import time
import torch
import random
import numpy as np
import sys
class Options(object):
"""docstring for Options"""
def __init__(self):
super(Options, self).__init__()
def initialize(self):
parser = argpar... | donydchen/ran_replicate | options.py | options.py | py | 8,936 | python | en | code | 10 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 85,
"usage_type": "call"
},
... |
43155226419 | import pandas as pd
import xgboost as xgb
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.model_selection import train_test_split
from utils.transfer_data import get_2022_stats
from utils.transfer_data import get_all_player_stats
iterations = 10
def XGBoos... | rogersheu/All-NBA-Predictions | models/XGBoostmodeling.py | XGBoostmodeling.py | py | 1,755 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "xgboost.XGBClassifier",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.confusion_matrix",
"line_number": 44,
"usage_type": "call"... |
35070571378 | # -*- coding: utf-8 -*-
import onnx
import time
import numpy as np
import onnxruntime as rt
from onnx import checker
from onnx import helper
from onnx import TensorProto
def conver_rknn_tensor_type_to_onnx_type(tensor_dtype):
datatype = tensor_dtype.split("_")[-1]
if datatype == "INT8":
return TensorPr... | zjd1988/rknn_onnx_cnvert | onnx_convert.py | onnx_convert.py | py | 33,616 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "onnx.TensorProto.INT8",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "onnx.TensorProto",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "onnx.TensorProto.UINT8",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name"... |
28270735498 | """
Tornado handler to edit/delete a log upload entry
"""
from __future__ import print_function
import os
from html import escape
import sqlite3
import sys
import tornado.web
# this is needed for the following imports
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../plot_app'))
from config... | PX4/flight_review | app/tornado_handlers/edit_entry.py | edit_entry.py | py | 3,361 | python | en | code | 170 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
27058011045 | from datetime import datetime, timedelta
import re
# returns a tuple where
# [0] current season (str)
# [1] open leagues (str)
def getSeasonOptions():
schedule = open("./leagues/league.schedule", "r").read().splitlines()
currentSeason = ""
for line in schedule:
if line.startswith("season"):
... | TimRamandt/PoGoPvPData | leagues.py | leagues.py | py | 2,553 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.findall",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 70,
"usage_type": "name"
},
{
"api_name": "datetime.timede... |
34984749614 | # Nikko Rush
# 7/12/17
"""
Run the preprocessor (ask for arguments, etc.) and feed the output into the gui
"""
import datetime
print(datetime.datetime.now())
import os
import os.path
import subprocess
import sys
# Import matplotlib to ensure the backend it set to tk
import matplotlib
matplotlib.use("TKAgg")
#from ... | nwrush/Visualization | Visualizer/startup.py | startup.py | py | 1,237 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.use",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.isf... |
7440933179 | import os
from flask import Flask, render_template, Response
from keras.models import load_model
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
from camera import VideoCamera
# Root directory of the project
ROOT_DIR = os.path.abspath(".")
# I... | Vibi007/bazingaa_unacademy_bootstrap | app.py | app.py | py | 6,854 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_num... |
46124195634 | import json
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.utils.translation import gettext_lazy as _
def format_request_data(request_data):
""" Format request data to a list """
# Convert the string to a list using json.loads()
result_list = json.loads(request_data)... | mupumadev1/DepositsIntegration | webapp/helpers.py | helpers.py | py | 1,366 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.core.paginator.Paginator",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "django.core.paginator.PageNotAnInteger",
"line_number": 27,
"usage_type": "call"
},
{
... |
10366504458 | from twilio.rest import Client
from account_details import account_detailss
class Info:
def __init__(self, location_to_be_reached, google_map_location,username,userbloodgroup,attender_number,sample_address):
# self.account_sid = "ACe599f3f9b69da75c72ad10b21b941c44"
# self.account_token = "... | venkat-palani/AutoBloodDonor | ONE_info.py | ONE_info.py | py | 3,658 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "account_details.account_detailss",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "twilio.rest.Client",
"line_number": 12,
"usage_type": "call"
}
] |
7017007921 | from datetime import datetime
from os import remove
datetime = str(datetime.now()) #Fetching date & time in a long big string
date = datetime[:10] #Separates date and time
time = datetime[11:]
time = time[:8 ] #Gets rid of the milliseconds
finalString = date + '\n' + time #Produces a final string that ... | theoneandonlysamduan/Project_Oracle | TimeModule.py | TimeModule.py | py | 574 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "datetime.datet... |
27590606734 | import pandas as pd
from dateutil.parser import parse
from sklearn.compose import ColumnTransformer
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
from sklearn.metrics import f1_score
from sklearn import preprocessing
import sklearn.metrics
import autosklearn.regression
impor... | BigDaMa/DFS | new_project/fastsklearnfeature/vision_paper/flight_delays_prediction.py | flight_delays_prediction.py | py | 5,124 | python | en | code | 12 | github-code | 18 | [
{
"api_name": "dateutil.parser.parse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.NAN",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.where",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "sklearn.pipeline.Pip... |
40301736368 | from PyQt5 import QtCore, QtGui, QtWidgets
class PacketFilterWidget(QtWidgets.QLineEdit):
on_valid = QtCore.pyqtSignal(list)
def __init__(self, parent=None):
super().__init__()
self.parent = parent
self._init_ui()
def _init_ui(self) -> None:
self.textChanged.connect(self.... | stephen-bunn/wireshrimp | wireshrimp/packet_filter.py | packet_filter.py | py | 1,131 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyQt5.QtWidgets.QLineEdit",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "P... |
23143331955 | import numpy as np
from scipy.stats import qmc
from src.experiments.interfaces.design_of_experiment import (
Experiment,
)
class LatinHypercube(Experiment):
"""Latin Hypercube design implemented within the experiment interface
See https://en.wikipedia.org/wiki/Latin_hypercube_sampling.
"""
def _... | nicolaipalm/oed | src/experiments/experiment_library/latin_hypercube.py | latin_hypercube.py | py | 1,353 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "src.experiments.interfaces.design_of_experiment.Experiment",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.ndarray",
"line_number": 18,
"usage_type": "attribute"... |
9081437580 | import json
import boto3
import os
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
# Slack integration
SEND_SLACK_MESSAGE = False
SLACK_CHANNEL = ''
HOOK_URL = ''
sns_client = boto3.client('sns')
sts_client = boto3.client('sts')
def lambda_handler(event, cont... | s50600822/Notes | AWS/sec/detect_mitigate_account_compromise_issues/Lambda_Process_AWS_RISK_Events.py | Lambda_Process_AWS_RISK_Events.py | py | 5,847 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "boto3.client",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": ... |
13295710111 | import translators as ts
# Название птицы: 'Eurasian Wren'
# Всю фразу переводит неверно, надо скармливать по одному
#
birds_name_en = 'Eurasian Wren'
birds_name_en_1 = 'Eurasian'
birds_name_en_2 = 'Wren'
translate_1= ts.google(birds_name_en, from_language='en', to_language='ru', if_use_cn_host=True)
translate_2= ts.... | koral5819/koral5819-TeleBot_BirdsVoices | translator/translator.py | translator.py | py | 620 | python | ru | code | 0 | github-code | 18 | [
{
"api_name": "translators.google",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "translators.google",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "translators.google",
"line_number": 12,
"usage_type": "call"
}
] |
11172049261 | import json
from itertools import groupby
from itertools import islice
import logging
from dojo.models import Finding
logger = logging.getLogger(__name__)
SEVERITY = "Info"
class GovulncheckParser:
def get_scan_types(self):
return ["Govulncheck Scanner"]
def get_label_for_scan_types(self, scan_type... | DefectDojo/django-DefectDojo | dojo/tools/govulncheck/parser.py | parser.py | py | 4,862 | python | en | code | 3,128 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "itertools.groupby",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "itertools.islice",
"... |
19131734883 | from collections import defaultdict
import sys
import math
class Heap():
def __init__(self):
self.array = []
self.size = 0
self.pos = []
def newMinHeapNode(self, v, dist):
minHeapNode = [v, dist]
return minHeapNode
def swapMinHeapNode(self, a, b):
t = self.... | scortizob/PrimHeap | primHeap.py | primHeap.py | py | 5,343 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "math.floor",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 81,
... |
28637057090 | import tempfile
from enum import Enum
import auditok
import librosa
import numpy as np
import requests
import soundfile as sf
from spleeter.separator import Codec, Separator
import storage
separator = Separator('spleeter:5stems')
class SpleeterTrack(Enum):
DRUMS_TRACK = 'drums'
VOCALS_TRACK = 'vocals'
... | fmelosilva/songuess-api | audio.py | audio.py | py | 2,668 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "spleeter.separator.Separator",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "librosa.load",
... |
72173645161 | import os
import sys
from tempfile import TemporaryDirectory
import shutil
from pathlib import Path, PurePosixPath
from json import load
sys.path.insert(0, os.path.dirname(__file__))
def test_create_isolate_sheet():
with TemporaryDirectory() as tmpdir:
workdir = os.path.join(Path(tmpdir), "workdir")
... | NRW-GEUBT/geuebt-validate | .tests/unit/test_create_isolate_sheet.py | test_create_isolate_sheet.py | py | 1,473 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "sys.path.insert",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
11619371962 | db_path = r".\db\test.db"
from flask import Flask, render_template, request
# from flask_bootstrap import Bootstrap
from Database import Database
import os
import hashlib
from PIL import Image
import json
app = Flask(__name__, template_folder = './assets')
def readFromSBP(plate_id):
try:
hash_code = "0"... | Nurts/CTO-flask-web-app | Main.py | Main.py | py | 3,321 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
"... |
15499879970 | #!/usr/bin/env python3
# coding: utf-8
# File: get_not_succeed.py
# Author: lxw
# Date: 5/31/17 9:19 AM
import json
from Spiders.CJOSpider.utils import get_redis_uri
from Spiders.CJOSpider.CJOSpider.settings import REDIS_HOST
from Spiders.CJOSpider.CJOSpider.settings import REDIS_PORT
from Spiders.CJOSpider.CJOSpider... | WenZuHuai/fintech_spider | Spiders/get_not_succeed.py | get_not_succeed.py | py | 2,554 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "Spiders.CJOSpider.utils.get_redis_uri",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Spiders.CJOSpider.CJOSpider.settings.REDIS_HOST",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "Spiders.CJOSpider.CJOSpider.settings.REDIS_PORT",
"... |
73172602280 | from django.urls import path
from . import views
app_name = 'app'
urlpatterns = [
path('register/', views.register, name='register'),
path('login/', views.login, name='login'),
path('logout/', views.logout, name='logout'),
path('', views.home, name='home'),
path('marketplace/', views.placeme... | danielc92/django-bidding-app | app/urls.py | urls.py | py | 676 | python | en | code | 15 | github-code | 18 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
39494082618 | # USDA National Nutrient Database Integration
from __future__ import absolute_import, division, print_function
import requests
USDA_NDB_API_PATH = 'http://api.nal.usda.gov/ndb/'
def search(api_key, search_term):
""" http://ndb.nal.usda.gov/ndb/doc/apilist/API-SEARCH.md
Internal params of interest
Sort t... | kaypro4/oakschoolfood | usda_ndb.py | usda_ndb.py | py | 1,446 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
}
] |
1422544977 | import cv2
import numpy as np
from bs import ScreenGrabber, Vector2
from ..typing import MazeLoader, Maze, MazeFactory
def fill_in_missing_lines(lines):
deltas = []
last_v = 0
for v in lines:
deltas.append(v - last_v)
last_v = v
_lines = []
tg = sorted(deltas)[len(deltas)//2]
... | en0/ai-goals | maze_game/loaders/edge_detecting_loader.py | edge_detecting_loader.py | py | 4,527 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "cv2.filter2D",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "cv2.filter2D",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number"... |
11172277911 | import datetime
import logging
import html2text
from defusedxml import ElementTree as etree
from cvss import CVSS3
from dojo.models import Endpoint, Finding
from dojo.tools.qualys import csv_parser
logger = logging.getLogger(__name__)
CUSTOM_HEADERS = {
"CVSS_score": "CVSS Score",
"ip_address": "IP Address"... | DefectDojo/django-DefectDojo | dojo/tools/qualys/parser.py | parser.py | py | 9,776 | python | en | code | 3,128 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "html2text.HTML2Text",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "cvss.CVSS3",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "dojo.models.Endpoint... |
41202630815 | """Flask app for Cupcakes"""
from flask import Flask, render_template, jsonify, request
from flask_debugtoolbar import DebugToolbarExtension
from models import *
app = Flask(__name__)
app.app_context().push()
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///blogly'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = ... | Dania-Irshad/APIs-Cupcakes | app.py | app.py | py | 2,537 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "flask_debugtoolbar.DebugToolbarExtension",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 29,
"usage_type": "call"
},
{
"api_nam... |
71969732519 | from django.core.urlresolvers import reverse
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from signup.utils import send_email
from .models import WictUser
class WictUserAdmin(admin.ModelAdmin):
def send_review_email(self, request, queryset):
reviewers = queryset.filter(... | fcoelho/wict | website/admin.py | admin.py | py | 1,318 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.core.urlresolvers.reverse",
"line_number": 13,
"usage_type": "call"
},
... |
33647561469 | import asyncio
async def foo():
print('----start foo')
await asyncio.sleep(2)
print('----end foo')
async def bar():
print('****start bar')
await asyncio.sleep(1)
print('****end bar')
async def main():
task1 = asyncio.create_task(foo())
task2 = asyncio.create_task(bar())
# task1... | olivetree123/coco-py | test2.py | test2.py | py | 461 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "asyncio.sleep",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "asyncio.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "asyncio.create_task",
... |
8363794077 | #!/usr/bin/env python3
# multi-processing
# Different processes live in different memory spaces, they don't share data
# Need special share memory objects to share data such as Value and Array
from multiprocessing import Pool
def cube(number):
return number * number * number
# When script is being run directly __... | nflondo/myprog | python/online-tutorials/freecodecamp-inte/multi_proc_pool.py | multi_proc_pool.py | py | 988 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "multiprocessing.Pool",
"line_number": 16,
"usage_type": "call"
}
] |
20020373765 | import wx,sys,subprocess,os
from BabelBrushVolumeHub import BabelBrushVolumeHub,create_directory_structure
class VolumeList(wx.ListCtrl):
def __init__(self, parent,volume_hub):
wx.ListCtrl.__init__(
self, parent, -1,
style=wx.LC_REPORT|wx.LC_VIRTUAL|wx.LC_HRULES|wx.LC_VRULES
... | Taylor-CCB-Group/BabelBrushVolumeManager | VolumeHubGUI.py | VolumeHubGUI.py | py | 10,417 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "wx.ListCtrl",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "wx.ListCtrl.__init__",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "wx.ListCtrl",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "wx.LC_REPORT",
... |
70407249961 | from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
# 重写 jwt 返回方法
def jwt_response_payload_handler(token, user=None, request=None):
"""
自定义jwt认证成功返回数据
"""
return {
'token': token,
'id': user.id,
'username': user.username
}... | RyanLin1995/python | django/meiduo_admin/meiduo_admin/meiduo_mall/apps/meiduo_admin/utils.py | utils.py | py | 892 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 26,
"usage_type": "call"
}
] |
72166390759 | """
Test conversions between image and dataframe.
"""
from itertools import product
import pytest
import numpy as np
from .._image import image_to_dataframe, dataframe_to_image
RND_SEED = 42
@pytest.mark.parametrize("number_of_bands", list(range(1, 20, 3)))
def test_image_to_dataframe(number_of_bands):
"""Test ... | joaopfonseca/ml-research | mlresearch/utils/tests/test_image.py | test_image.py | py | 3,454 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "numpy.random.default_rng",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.default_rng",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "n... |
31863028829 | import gzip
from lxml import etree
def open_xournal(filename):
with gzip.open(filename, 'rb') as f:
ET = etree.parse(f)
ET.getroot().remove(ET.xpath('//preview')[0])
return ET
class XournalLayer:
def __init__(self):
self.items = []
@classmethod
def fromelem(cls, elem):
... | llandsmeer/xpp3m | xppm3.py | xppm3.py | py | 5,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "gzip.open",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "lxml.etree.parse",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "lxml.etree.tostring",
"line_nu... |
73039779241 | import torch
from torch.utils.data import Dataset
import os
import json
from random import randint
from torch import nn
from torch.nn import functional as F
import pandas as pd
import numpy as np
def make_dataset(directory, class_to_idx):
instances = []
directory = os.path.expanduser(directory)
for target... | davidelobba/FER_SPRING | data/CAER_LD.py | CAER_LD.py | py | 3,069 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.expanduser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
35742772884 | import os, sys
from sklearn.svm import OneClassSVM
from analog.bin.machine_learning.TfidfVector import TfidfVector
from datetime import datetime
import re
import numpy as np
from urllib.parse import unquote
from sklearn.model_selection import ParameterGrid
import pickle
class Train:
def __init__(self, path=None):... | xiaoyuge16/analog | analog/bin/machine_learning/train.py | train.py | py | 9,783 | python | en | code | null | github-code | 18 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 1... |
39010824194 | import altair as alt
import pandas as pd
def altair_scatter_plot(df: pd.DataFrame) -> alt.vegalite.v4.api.Chart:
base_options = list(df['artist_name'].unique())
base_options.sort()
options = [None] + base_options
options_labels = ['All artists'] + base_options
input_dropdown = alt.binding_select(... | TassaraR/spotify-rabbit-hole | streamlit_app/tracks_viz.py | tracks_viz.py | py | 2,167 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.DataFrame",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "altair.binding_select",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "altair.selection_single",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "al... |
4114425211 | import pytest
import unittest
import os
import sys
import subprocess
import fvid
import ffpb
import tqdm
import platform
from helper import SkippableTest
from shlex import split
from collections import namedtuple
from functools import reduce
proc_output = namedtuple('proc_output', 'stdout stderr')
def pipeline(start... | AlfredoSequeida/fvid | tests/encoding_test.py | encoding_test.py | py | 3,470 | python | en | code | 345 | github-code | 18 | [
{
"api_name": "collections.namedtuple",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "functool... |
72153928361 | from flask import Flask, render_template, request
from services.process import calculate
app = Flask(__name__, template_folder="templates",
static_folder='static')
app.jinja_env.auto_reload = True
app.config['TEMPLATES_AUTO_RELOAD'] = True
@app.route('/')
def index():
return render_template('index.ht... | alexandreHenrotte/SleepWell | app.py | app.py | py | 693 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.request.args.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.request... |
16877923759 | import argparse
import io
import math
import random
import tarfile
import tempfile
from functools import partial, reduce
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Tuple
import psutil
import webdataset as wds
import numpy as np
import pandas as pd
import rioxarray
import xarray a... | cwerner/deadtrees | scripts/createdataset.py | createdataset.py | py | 14,962 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pathlib.Path.ls",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"... |
4095482311 | from typing import List
def path_to_coordinates(
path: List[str], coordinates: dict = None, previous_position=(0, 0), previous_step=1
) -> dict:
coordinates = coordinates if coordinates else dict()
if not path:
return coordinates
x, y = previous_position
direction, distance = path[0][0],... | chrisittner/aoc-2019 | a3/wires.py | wires.py | py | 2,116 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 38,
"usage_type": "name"
}
] |
733143634 | from skimage import io
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage
from math import sqrt,pi
# Manual mean filter to show the working of convolution
# Takes in the size of the kernel and input image as parameters
def mean_filter_manual(size,img):
correction = size//2
kernel = np.divid... | ashrith1516/ImageVideoProcessing | Smoothing_Techniques/smoothing.py | smoothing.py | py | 4,626 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.divide",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.copy",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.divide",
"line_number": ... |
31917998904 | import boto3
import logging
from boto3.dynamodb.conditions import Key
from datetime import datetime
from utils.helper_wo_pandas import weekly_data_db, store_in_s3_bucket_wo_pandas, region, buckets
def handler(event, context) -> None:
"""
Create the weekly query and store it in S3
"""
ta_place_id = eve... | KristiyanBulga/TFM_project | data_processing/functions/create_weekly_query.py | create_weekly_query.py | py | 4,221 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.today",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
34272225204 | """ Greet tests on the CLI """
from click.testing import CliRunner
from example.greet import greet
def test_greet_cli():
"""Case with only time zone"""
runner = CliRunner()
result = runner.invoke(greet, ["Europe/Istanbul"])
assert result.exit_code == 0
assert "Hello, Istanbul!" in result.output
| evillase/py_project_template | test/test_greet.py | test_greet.py | py | 319 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "click.testing.CliRunner",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "example.greet.greet",
"line_number": 10,
"usage_type": "argument"
}
] |
31867271050 | import asyncio
import shlex
import sys
import yaml
@asyncio.coroutine
def build(versions_file, *, loop):
with open(versions_file) as f:
config = yaml.load(f.read())
procs = []
for version_map in config['versions']:
args = shlex.split('make docker-build '
'IMAG... | dmrz/kafka-docker-builder | build.py | build.py | py | 915 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "yaml.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "shlex.split",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "asyncio.create_subprocess_exec",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "asyncio.gather",... |
23140138932 | import argparse
import os
from importlib import resources
import re
import contextlib
import sys
import polycotylus
class CompletionAction(argparse.Action):
files = {
"fish": "polycotylus.fish",
}
def __call__(self, parser, namespace, shell, option_string=None):
with contextlib.suppress(... | bwoodsend/polycotylus | polycotylus/__main__.py | __main__.py | py | 4,928 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.Action",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "contextlib.suppress",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.stdout.isatty",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.stdout... |
75279215719 | from Products.statusmessages.interfaces import IStatusMessage
from zope import component
from zope import event
from collective.rcse.action import ajax
from collective.rcse.content.group import GroupSchema
from collective.rcse.content.proxygroup import ProxyGroupSchema
from collective.rcse.event import UserRolesModifi... | collective/collective.rcse | collective/rcse/action/join.py | join.py | py | 3,431 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "collective.rcse.action.ajax.AjaxAction",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "collective.rcse.action.ajax",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "collective.rcse.content.group.GroupSchema",
"line_number": 15,
"u... |
36016563597 | from torch.utils.data import Dataset
import torch
from PIL import Image
import numpy as np
import torchvision.transforms as ttf
device = "cuda" if torch.cuda.is_available() else "cpu"
class GAN_Data(Dataset):
def __init__(self, path_list, transforms= None):
super().__init__()
self.pat... | 04RR/MedSRGAN | dataset.py | dataset.py | py | 1,006 | python | en | code | 11 | github-code | 18 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data.Dataset",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvi... |
42129325154 | from typing import Dict, List, Literal, Optional, TextIO, Tuple, TYPE_CHECKING
from iniparse import RawConfigParser as ConfigParser
import logging
import os
import re
import string
import sys
try:
from debian.deb822 import Deb822
HAS_DEB822 = True
except ImportError:
HAS_DEB822 = False
from subscription... | candlepin/subscription-manager | src/subscription_manager/repofile.py | repofile.py | py | 24,367 | python | en | code | 61 | github-code | 18 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "rhsmlib.services.config.Config",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": ... |
1767553544 | import telegram
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, ConversationHandler, MessageHandler, Filters, CallbackContext, \
CallbackQueryHandler, PollAnswerHandler
import logging
import Database
from math import sqrt, ceil
from He... | CraveToCode/groupify | Organiser.py | Organiser.py | py | 23,950 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "Database.db",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "Database.db",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "Database.db",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "Database.db",
... |
11354829288 | import jira
from appenlight.models.integrations import IntegrationBase, IntegrationException
_ = str
class NotFoundException(Exception):
pass
class JiraIntegration(IntegrationBase):
__mapper_args__ = {"polymorphic_identity": "jira"}
front_visible = True
as_alert_channel = False
supports_report_... | AppEnlight/appenlight | backend/src/appenlight/models/integrations/jira.py | jira.py | py | 4,607 | python | en | code | 35 | github-code | 18 | [
{
"api_name": "appenlight.models.integrations.IntegrationBase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "jira.client.JIRA",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "jira.client",
"line_number": 28,
"usage_type": "attribute"
},
{
"... |
32520330326 | # Importando bibliotecas necessárias
import requests , urllib3
import numexpr
# Desativando a exibição de mensagens de aviso relacionadas à conexão SSL
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# URL do desafio
u... | Claudio-Prates/Exercicios---CySource | MeuAPI/Desafio_Hacking1.py | Desafio_Hacking1.py | py | 2,357 | python | pt | code | 1 | github-code | 18 | [
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning",
"line_number": 7,
"usage_type": "argument"
},
{
"api_name": "requests.packages",
"line_number": 7... |
29728573007 | import json
import logging
from hashlib import sha1
from datetime import datetime
from typing import Union, Callable, Awaitable, Optional, List, Any, Tuple
from uuid import uuid4
from dotty_dict import dotty
from pydantic import PrivateAttr, validator, BaseModel, ValidationError
from tracardi.exceptions.exception_ser... | Tracardi/tracardi | tracardi/domain/payload/tracker_payload.py | tracker_payload.py | py | 29,387 | python | en | code | 430 | github-code | 18 | [
{
"api_name": "logging.getLogger",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tracardi.config.tracardi.logging_level",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "tracardi.config.tracardi",
"line_number": 36,
"usage_type": "name"
},
{... |
34803645296 | import boto3
import json
import os
from string import Template
from .safe_kwargs import safe_kwargs
PATH_REGEX = r'^[a-zA-Z0-9_/-]*[^/]$'
FILE_KEY_REGEX = r'^([a-zA-Z0-9_-]+[a-zA-Z0-9_-]*/)*([a-zA-Z0-9_-]*\.[a-zA-Z0-9_]+)$'
##############################################################################################... | khartes/awsomeutils | awsomeutils/s3.py | s3.py | py | 5,849 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "safe_kwargs.safe_kwargs",
... |
21809102643 | from hashlib import sha1
from pyexpat import model
from sqlite3 import TimestampFromTicks
from typing_extensions import Required
from django.db import models
from django.apps import apps
from django.urls import reverse
import uuid
from datetime import date
from django.contrib.auth.models import User
from mult... | lebegueduweb/crun | labapp/models.py | models.py | py | 4,761 | python | fr | code | 0 | github-code | 18 | [
{
"api_name": "django.db.models.Model",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "django.db.models.UUIDField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name"... |
1846986721 | """Add meta to file
Revision ID: ab5b51940dfc
Revises: 9a91325da470
Create Date: 2021-09-16 21:34:08.756075
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "ab5b51940dfc"
down_revision = "9a91325da470"
branch_labels = None
depends_on = None
def upgrade():
... | sechava4/video-scrubber | migrations/versions/ab5b51940dfc_add_meta_to_file.py | ab5b51940dfc_add_meta_to_file.py | py | 644 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.JSON",
... |
38752718788 | import unittest
import numpy as np
import torch
from pytorch_lightning.utilities.parsing import AttributeDict
from imap.data.camera_info import CameraInfo
from imap.data.seven_scenes_dataset_factory import DEFAULT_CAMERA_MATRIX
from imap.data.seven_scenes_frame_loader import SevenScenesFrameLoader
from imap.model.ner... | MisterMap/imap-pytorch | test/test_keyframe_validator.py | test_keyframe_validator.py | py | 2,086 | python | en | code | 9 | github-code | 18 | [
{
"api_name": "unittest.TestCase",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pytorch_lightning.utilities.parsing.AttributeDict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pytorch_lightning.utilities.parsing.AttributeDict",
"line_number": 2... |
28373531237 | from collections import Counter
from nltk import word_tokenize
import PyPDF2
def load_pdf(path):
with open(path, "rb") as f:
pdf = PyPDF2.PdfReader(f)
text = " ".join(page.extract_text() for page in pdf.pages)
return text
class TextDocument:
"""Text Document that can be initialized with ... | mzoesch/SymProg | 20221108/hw04_nltk/documentRecSol.py | documentRecSol.py | py | 1,604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PyPDF2.PdfReader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "nltk.word_tokenize",
"line_number": 25,
"usage_type": "call"
}
] |
32472698419 | __license__ = "Cecill-C"
__revision__ = " $Id: actor.py 1586 2009-01-30 15:56:25Z cokelaer $ "
__docformat__ = 'reStructuredText'
import re
import logging
import pyshark
class CapPacket(object):
"""This class docstring shows how to use sphinx and rst syntax
The first line is brief explanation, which may... | AprilYuan/DummyPrj | check_cap.py | check_cap.py | py | 11,330 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "re.search",
"line_number": 125,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 156,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 162,
"usage_type": "call"
},
{
"api_name": "logging.error",
"line_number":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.