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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9122671458 | # -*- coding: utf-8 -*-
import decimal
from functools import reduce
import json
from typing import Any, Dict, List, Optional, Tuple, Union
from django.db import connection
from catmaid.error import ClientError
class StateMatchingError(ClientError):
"""Indicates that a state check wasn't successful"""
def _... | catmaid/CATMAID | django/applications/catmaid/state.py | state.py | py | 14,180 | python | en | code | 178 | github-code | 7 | [
{
"api_name": "catmaid.error.ClientError",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 106,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
... |
45337746114 | # Add some right click options
# stdlib imports
from copy import copy
import math
# Local imports
from ..utils.misc import get_root_node, clone_node
from ..ModelExporter.utils import get_children
# Blender imports
import bmesh
import bpy
from bpy.types import Menu, Operator
from mathutils import Matrix
CONE_ROTATI... | monkeyman192/NMSDK | BlenderExtensions/ContextMenu.py | ContextMenu.py | py | 12,936 | python | en | code | 24 | github-code | 7 | [
{
"api_name": "mathutils.Matrix.Rotation",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mathutils.Matrix",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "math.radians",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bpy.types.Ope... |
2849809346 | import pygame
from pygame.locals import Color, Rect
import random
from graphics import *
import pieces
import piece
random.seed()
class GameFunctions:
def new_piece(self):
"""Creates a new piece and places it at the top of the well."""
piecesCount = len(pieces.PieceTypes.AllPieceTypes)
next_piec... | NUNUG/kcc_2019 | python/src/functions.py | functions.py | py | 12,690 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pieces.PieceTypes",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "piece.Piece",
"l... |
19547354829 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Additional hypothesis-testing routines to supplement
``scipy.stats`` and ``statsmodels``.
"""
from __future__ import absolute_import
from __future__ import with_statement
from __future__ import division
from __future__ import nested_scopes
from __future__ import generators
... | michaelerule/neurotools | stats/tests.py | tests.py | py | 4,659 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "numpy.float32",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "neurotools.stats.information.betapr",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "neurotools.stats.information.betapr",
"line_number": 45,
"usage_type": "call"
},
{
... |
41500068233 | import logging
import re
from collections import defaultdict
from urllib.parse import urljoin
import requests_cache
from tqdm import tqdm
from configs import configure_argument_parser, configure_logging
from constants import (
BASE_DIR,
DOWNLOADS_DIR,
MAIN_DOC_URL,
MAIN_PEP_URL,
WHATS_NEW_URL,
... | yonvik/bs4_parser_pep | src/main.py | main.py | py | 5,092 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tqdm.tqdm",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "utils.get_soup",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "constants.WHATS_NEW_URL",
"line_number": 37,
"usage_type": "argument"
},
{
"api_name": "urllib.parse.url... |
21568967983 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d, Axes3D
mu = 398600 #[km^3/s^2]
I_vec = np.array([1.0, 0.0, 0.0])
J_vec = np.array([0.0, 1.0, 0.0])
K_vec = np.array([0.0, 0.0, 1.0])
def mag(a):
return np.linalg.norm(a)
def state_to_orbital_elements(pos, ve... | SchwartzCode/MAE-3135_Orbital_Mechanics | hw4_q2.py | hw4_q2.py | py | 3,787 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.norm",
"line_number... |
20885124162 | import MDAnalysis as mda
from subprocess import call
from tqdm import tqdm
def Dcd2Xtc(psf, dcd):
psffile = psf
dcdfile = dcd
xtcfile = dcdfile[0:-4] + '.xtc'
u = mda.Universe(psffile, dcdfile)
with mda.Writer(xtcfile, u.atoms.n_atoms)as w:
for ts in tqdm(u.trajectory,
... | tanaty5828/pymodules | dcd2xtc.py | dcd2xtc.py | py | 494 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "MDAnalysis.Universe",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "MDAnalysis.Writer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
... |
37949203669 | import logging
import pandas as pd
from pathlib import Path
# Create logger
logger = logging.getLogger(__name__)
def get_logfc_matrix(paths):
"""
Combines contrast files and returns it as a matrix with a multi-level
index.
"""
# Output format
# basemean, l... | SpikyClip/rna-features | rnafeatures/expression/logfc_matrix.py | logfc_matrix.py | py | 1,922 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 36,
"usage_type": "call"
}
] |
34574249028 | import logging
import coloredlogs
def init_log(logfile, loglevel):
format_string = '%(asctime)s [%(process)d] [%(levelname)s] (%(name)s:%(funcName)s) %(message)s'
time_string = "%y-%m-%d %H:%M:%S"
console_formatter = coloredlogs.ColoredFormatter(format_string, time_string)
console_handler = logging.Str... | allefabbri/meme | app/utils/log.py | log.py | py | 1,341 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "coloredlogs.ColoredFormatter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "logging.StreamHandler",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.Formatter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "lo... |
38498517956 | import requests
url = 'https://rickandmortyapi.com/api/'
endpointCharacter = 'character/'
characterList = [] #List to append character info
########## FETCH DATA FUNCTION ##########
def fetchData(url, listName): #Function parameters --> url: API url, listName: list to append the results
print('Fetching data...... | alonsomtoledano/python | RickAndMortyAPI_Sync/rickAndMortySDK.py | rickAndMortySDK.py | py | 2,709 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 14,
"usage_type": "call"
}
] |
4904934321 | import pygame
from random import randrange
# O pygame usa o sistema RGB (Red, Green, Blue) para definição de cores e utiliza tupla.
branco = (255, 255, 255)
preto = (0, 0, 0,)
vermelho = (255, 0, 0)
verde = (0, 255, 0)
azul = (0, 0, 255)
try:
pygame.init()
except:
print('O módulo pygame não foi inicializado ... | NicolasSantos82/Snake | Snake1.2.py | Snake1.2.py | py | 9,152 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mod... |
14113606090 | import re
import enum
import sys
from os.path import exists
# Set holding our lexeme units. We use a set of regular expressions to match for lexemes for parsing later.
class Tokens(enum.Enum):
keyword = r'(chapa|kama|jaza|kwisha|kwanza|eleza|aina|rudisha)' # Regular expression for keywords
function = r'([a-zA... | Hamri-language/Hamri | LexicalParser.py | LexicalParser.py | py | 6,217 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number... |
14718589629 | #!/usr/bin/env python
# coding: utf-8
# Author: Tong ZHAO
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
from torch.autograd import Variable
from torchvision import models
pretrained_mean = torch.tensor([0.485, 0.456, 0.406], requires_grad = False).view((1, 3, 1, 1))
pretrained_std = torch.t... | Tong-ZHAO/topology_aware_delineation | src/model.py | model.py | py | 5,155 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "torch.tensor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_n... |
23024607541 | from jax.experimental.ode import odeint
import jax.numpy as jnp
from jax.experimental.host_callback import id_print
import os
#==============================================================================
# Define functions
#==============================================================================
# General co... | sjt48/PyFlow | TFE_jax/ode_test.py | ode_test.py | py | 4,202 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "jax.numpy.einsum",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "jax.numpy.einsum",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_num... |
11530183795 | from flask import (
request,
)
from typing import Tuple
from ApplicationModels.RegisterWebUserForm import RegisterWebUserForm
from ApplicationModels.PageContents import PageContents, RegisterFormData
class ViewRegisterUseCase():
def execute(
self,
page_contents: PageContents[RegisterFormData]
... | fezzlk/mahjong-manager-bot | src/use_cases/web/ViewRegisterUseCase.py | ViewRegisterUseCase.py | py | 643 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "ApplicationModels.PageContents.PageContents",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ApplicationModels.PageContents.RegisterFormData",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "ApplicationModels.RegisterWebUserForm.RegisterWebUser... |
41434741724 | #import cartopy.crs as ccrs
import xarray as xr
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import pylab
#import pandas as pd
#import numpy as np
#import datetime
#from datetime import datetime
import matplotlib.dates as mdates
from matplotlib.dates import DateFormatter
from matplotlib.ticke... | Wanhenri/newProjectPy | precAnalise/serieTemporal_all_Var.py | serieTemporal_all_Var.py | py | 6,129 | python | pt | code | 1 | github-code | 7 | [
{
"api_name": "matplotlib.pylab.rcParams",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pylab",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "seaborn.set_style",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "sea... |
24989289391 | import numpy as np
from pydub import AudioSegment
def encode_audio_to_array(audio_file, output_file):
try:
audio = AudioSegment.from_file(audio_file)
samples = np.array(audio.get_array_of_samples())
encoded_array = ','.join(map(str, samples))
with open(output_file, 'w') as outfile:
... | georgegesite/PYTHON-PROJECTS | Random/encoder.py | encoder.py | py | 751 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pydub.AudioSegment.from_file",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pydub.AudioSegment",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
}
] |
26851103100 | import logging
import http.client as http_client
import os
SEARCH_API_URL_FORMAT = 'https://api.{env}.bookshareunifiedsearch.org/search'
INGESTION_URL_FORMAT = 'https://ingest.{env}.bookshareunifiedsearch.org/records'
DELETE_URL_FORMAT = 'https://ingest.{env}.bookshareunifiedsearch.org/recordDeletes'
GET_URL_FORMAT =... | uvalib/emma-index | emma-search-ingest/api/lambda/tests/integration/config.py | config.py | py | 1,373 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "http.client.HTTPConnection",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "http.c... |
5107335355 | import random
from db_conn import get_db_connection
from subprocess import STARTF_USESTDHANDLES
from flask import Blueprint, request
from users import get_single_user
quality = Blueprint('quality', __name__)
@quality.route('/quality', methods=['GET'])
def get_quality_info():
conn = get_db_connection()
info ... | cosmin-paunica/SmartShower | quality.py | quality.py | py | 1,057 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "db_conn.get_db_connection",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "db_conn.get_db_connection",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "ra... |
25887601585 | import json
from db import db
from flask import Flask
from flask import request
from db import Party
from db import User
import os
app = Flask(__name__)
app = Flask(__name__)
db_filename = "findmyparty.db"
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///%s" % db_filename
app.config["SQLALCHEMY_TRACK_MODIFICATIO... | nirbhaysinghnarang/find_my_party_backend | src/main.py | main.py | py | 5,196 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "db.db.init_app",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "db.db",
"line_number": 20,... |
2044595446 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 11:28:11 2021
@author: Jouni Kuusisto
* insert filename in if __name__ == '__main__': section at the bottom
*numpy-stl library displays error message of a not closed mesh when calling get_mass_properties() even
when a closed mesh (from FreeCAD v0.18 as .SL... | JouniKuusisto/3d_sphericity | sphericity.py | sphericity.py | py | 7,632 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "stl.mesh.Mesh.from_file",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "stl.mesh.Mesh",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "stl.mesh",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "stl.mesh.Mesh",
... |
15146289017 | #Đề: Quản lý học sinh
# tên
# tuổi
# lớp
# điểm toán, văn anh
# fuc: tính điểm trung bình
# tính năm sinh
import os
# clearConsole = lambda: os.system('cls' if os.name in ('nt', 'dos') else 'clear')
# clearConsole()
# #Clear console cho nó gọn
import da... | quangngonz/Quan-Li-Hoc-Sinh | quanli.py | quanli.py | py | 8,158 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk.Treeview",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "tki... |
20439025267 | # Buddy 챗봇 모델을 API 형태로 발행할 때 필요한 py 파일
import sys
import torch
import torch.nn as nn
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import bson
import base64
from tqdm import tqdm
from flask import Flask, render_template, request, jsonify, json, Response, make_response... | School-is-hard/buddy_KoBERT | buddy.py | buddy.py | py | 12,053 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
45910519744 | import pygame
from pygame.locals import *
from sys import exit
from random import randint
pygame.init()
red = (255, 0, 0)
black = (0, 0, 0)
white = (255, 255, 255)
green = (10, 10, 255)
width = 640
height = 480
x_cobra = int(width/2)
y_cobra = int(height/2)
vel = 10
x_control = vel
y_control = 0
xc ... | Vkakarott/Game-Snake | Snake.py | Snake.py | py | 3,672 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pygame.font.SysFont",
"l... |
71339435745 | # python soln.py 0.09s user 0.02s system 70% cpu 0.161 total
import itertools
# ---------------- Class Setup ----------------------
class Octopus:
def __init__(self, level):
self.level = level
self.flashed_this_step = False
def __repr__(self):
return f"{str(self.level):>2}"
class... | drew-ellingson/advent_of_code_2021 | day_11/soln.py | soln.py | py | 3,064 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.product",
"line_number": 34,
"usage_type": "call"
}
] |
13775583227 | import torch
import os
import numpy as np
import re
from src.config import cfg
from src.data import make_gallery_loader, make_query_loader
from src.modeling import build_model
from src.data.transforms import build_transforms
def Singleton(cls):
_instance = {}
def _singleton(*args, **kargs):
if cls ... | LuffysMan/ReidApplicationDemo | src/reid_model.py | reid_model.py | py | 7,592 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "src.config.cfg",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_... |
2167480026 | from typing import Iterable, Optional
from django.contrib.auth import get_user_model
from django.db import models
TASK_STATUS_CHOICES = [
('N', 'NEW'),
('I', 'IN PROGRESS'),
('P', 'IN PAUSE'),
('D', 'DONE'),
]
TASK_PRIORITY_CHOICES = [
('HH', 'Highest'),
('H', 'High'),
('M', 'Medium'),
... | rogeriosilva-ifpi/ifpi-ads-2023.1-engiv | api_tasks/tasks/models.py | models.py | py | 684 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 24,
"usage_type": "name"
},
{
"a... |
29562068957 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
admin.site.site_header = "Mickey Ice Creams Admin"
admin.site.site_title = "Mickey Ice Creams Admin Portal"
admin.site.index_title = "Welcome to Mickey Ice Creams"
urlpatterns = [
path('admin/', admi... | anandlm12/IceCream-Centre | Hello/Hello/urls.py | urls.py | py | 371 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.admin.site",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 7,
"usage_type": "attribute"
},
{
"a... |
43793538170 | # import the opencv library
import cv2
import os
from time import time
import numpy as np
from buffer import Buffer
from face_detect import FaceDetection, pixelate
once = True
tracker = cv2.TrackerMIL_create()
backtracker = cv2.TrackerMIL_create()
detector = FaceDetection()
frame_buffer = Buffer(30)
my_img_1 = np.z... | aakashres/AR-Research-Python | partial object detection/partialdetection.py | partialdetection.py | py | 3,213 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cv2.TrackerMIL_create",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.TrackerMIL_create",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "face_detect.FaceDetection",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
24566292417 | from __future__ import annotations
from typing import Any, Tuple
from langchain.chains.query_constructor.ir import (
Comparator,
Comparison,
Operation,
Operator,
StructuredQuery,
Visitor,
)
from langchain.vectorstores.redis import Redis
from langchain.vectorstores.redis.filters import (
Re... | langchain-ai/langchain | libs/langchain/langchain/retrievers/self_query/redis.py | redis.py | py | 3,283 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "langchain.chains.query_constructor.ir.Comparator.EQ",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "langchain.chains.query_constructor.ir.Comparator",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "langchain.chains.query_constructor.ir.C... |
4258694097 | import matplotlib.pyplot as plt
import numpy as np
def barChart():
x = np.arange(4)
y1 = np.random.randint(20, 50, 4)
y2 = np.random.randint(10, 60, 4)
plt.figure(figsize=(6, 4), dpi=120)
# 通过横坐标的偏移,让两组数据对应的柱子分开
# width参数控制柱子的粗细,label参数为柱子添加标签
plt.bar(x - 0.1, y1, width=0.2, label='销售A组')
... | FreshSmall/Python-Project | Day100/Day75.py | Day75.py | py | 2,276 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "numpy.arange",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random.randint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randint... |
18186736746 | from msilib import sequence
import os
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from datetime import date
from random import randint
from numpy.typing import ArrayLike
from pandas import DataFrame
from typing import Tuple
from typing import List
from typing import Un... | zacherysmith115/cmpsc445-model | model/preprocess.py | preprocess.py | py | 12,811 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.keras.losses.MeanSquaredError",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tensorflow.optimizers.Adam",
"line_number": 44,
"usage_type": "call"
},... |
36037248507 | import os
import click
from tqdm import tqdm
import spoteno
@click.command()
@click.argument('source_path', type=click.Path(exists=True))
@click.argument('target_path', type=click.Path())
def run(source_path, target_path):
if not os.path.isfile(target_path):
os.makedirs(os.path.dirname(target_path), exis... | german-asr/german-asr-lm | scripts/to_characters.py | to_characters.py | py | 828 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_n... |
15082673206 | # -*- coding:UTF-8 -*-
import re
def get_score_from_file_GM_new(): #read P1 P2 P3 for calculate the final score
scores = []
scores_num = []
f_data = open("result.txt", "r")
try:
all_the_text = f_data.read()
every_frame_information = all_the_text.split('query')
for string in... | BIT-TYJ/SSGM | analyze-scenenet-209.py | analyze-scenenet-209.py | py | 4,315 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 110,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.legend",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "... |
31615388999 | import pygame, math, sys
def refresh(screen, player, grid):
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.MOUSEBUTTONUP:
pos = pygame.mouse.get_pos()
column = math.floor(pos[0] / 100)
return _add_pi... | rollnumber32/connect4 | support.py | support.py | py | 1,302 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.event.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.event",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.QUIT",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line... |
40976115464 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
class CursoAutomacao:
def __init__(self):
chrome_options = Options()
chrome_options.add_argument('--lang=pt-BR')
self.driver = webdriver.Chrome(executable_path=r'./chromedriver.exe', o... | thiagocarvalhorodrigues/Wavesbot | WavesBot.py | WavesBot.py | py | 1,357 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
... |
74530723103 | import numpy
import torch
import random
class ToTensor(object):
"""Convert ndarrays in sample to Tensors."""
def __call__(self, sample):
clip_len = len(sample)
trans_clip = []
for i in range(clip_len):
trans_clip.append(torch.from_numpy(sample[i]))
return trans_clip
class SpacialCrop(objec... | BestJuly/VCP | transform.py | transform.py | py | 1,697 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "torch.from_numpy",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 32,
"usage_type": "call"
}
] |
9942451646 | from __future__ import unicode_literals
import ezdxf
# FILENAME = r'C:\Users\manfred\Desktop\Now\page_setup_R12.dxf'
FILENAME = 'page_setup_R12.dxf'
def draw_raster(dwg):
marker = dwg.blocks.new(name='MARKER')
attribs = {'color': 2}
marker.add_line((-1, 0), (1, 0), dxfattribs=attribs)
marker.add_line(... | YunbiaoCao/ezdxf | examples/page_setup_R12.py | page_setup_R12.py | py | 2,980 | python | en | code | null | github-code | 7 | [
{
"api_name": "ezdxf.new",
"line_number": 66,
"usage_type": "call"
}
] |
19214349023 | import Downsampling.downsampling_data_distributions as ddd
from matplotlib import pyplot as plt
import matplotlib.mlab as mlab
import Recurrent_ANN.read_data as rd
import math
import numpy as np
def plot_downsample_norm_dists(data_range= None, fifty=False, decimate=False, resample=False, average=False, every_second=Fa... | ntnu-ai-lab/HUNT4-HAR | LSTM/Data_analysis/plot_downsampled_data_stats.py | plot_downsampled_data_stats.py | py | 3,495 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "Downsampling.downsampling_data_distributions.norm_dist_differences",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "Downsampling.downsampling_data_distributions",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Downsampling.downsampling_data_dist... |
24817732007 | import bottlenose
import logging
import random
import time
from bs4 import BeautifulSoup
from dateutil import parser
from price_monitor import (
app_settings,
utils,
)
from urllib.error import HTTPError
logger = logging.getLogger('price_monitor.product_advertising_api')
class ProductAdvertisingAPI(objec... | ponyriders/django-amazon-price-monitor | price_monitor/product_advertising_api/api.py | api.py | py | 7,313 | python | en | code | 153 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bottlenose.Amazon",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "price_monitor.app_settings.PRICE_MONITOR_AWS_ACCESS_KEY_ID",
"line_number": 30,
"usage_type": "attrib... |
34155332575 | # Chem Kit V2.0 - main.py
# Author: Finn Bear
# Date: December 6, 2016
#########
# Input #
#########
# Gassium [Ga] (A fictional gas)
gassium_particles_initial = 150 # How many gassium particles are in the simulation initially
gassium_rate = 0 # How many gassium particles to add or subtract each tick
gassium_radius =... | finnbear/chem-kit | V2.0/src/main.py | main.py | py | 7,806 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 87,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 87,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 96,
"usage_type": "call"
},
{
"api_name": "os.system",
... |
9675318596 | try:
import sys
if sys.__name__ is None:
raise ImportError("OMG! we could not import os. We're like in the matrix! ABORT. ABORT.")
except Exception as err:
raise ImportError(err)
try:
if 'os' not in sys.modules:
import os
else: # pragma: no branch
os = sys.modules["""os"""]
except Exception:
raise Import... | reactive-firewall/PiAP-python-tools | piaplib/pku/__main__.py | __main__.py | py | 5,513 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.__name__",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.modules",
... |
12719814775 | import os
from flask import render_template, Blueprint, current_app, request, send_from_directory, flash, redirect, url_for, abort
from flask_login import login_required, current_user
from ..decorators import confirm_required, permission_required
from ..extensions import db
from ..models import Photo, Comment, Tag
fro... | FIREcup/second-albumy | albumy/blueprints/main.py | main.py | py | 9,267 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "flask.req... |
72410320543 | #-*-coding:utf-8-*-
# date:2020-03-28
# Author: X.L.Eric
# function: image B G R show
import cv2 # 加载OpenCV库
import numpy as np
if __name__ == "__main__":
img_h = 320
img_w = 480
img = np.zeros([img_h,img_w,3], dtype = np.float)
img[:,:,0].fill(1.0)
cv2.namedWindow('B', 1)
cv2.imshow('B', img)... | XLEric/primary_cv_course | chapter_01/example_1-4.py | example_1-4.py | py | 669 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.namedWindow",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_n... |
28600969530 | from future.utils import iteritems
import difflib
from recipe_engine.post_process import DropExpectation
DEPS = ['cipd', 'json', 'path', 'properties', 'step', 'swarming', 'buildbucket']
EXECUTION_TIMEOUT_SECS = 3600
def RunSteps(api):
api.swarming.ensure_client()
# Create a new Swarming task request.
reque... | luci/recipes-py | recipe_modules/swarming/examples/full.py | full.py | py | 11,115 | python | en | code | 22 | github-code | 7 | [
{
"api_name": "difflib.unified_diff",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "difflib.unified_diff",
"line_number": 111,
"usage_type": "call"
},
{
"api_name": "future.utils.iteritems",
"line_number": 218,
"usage_type": "call"
},
{
"api_name": "re... |
17971988669 | import bisect
import math
from math import atan2
import pygame
from sprites import X, Y
import random
MAX_TERRAIN = 200
MIN_TERRAIN = 0
LINE_WIDTH = 2
class OutOfMapException(Exception):
pass
class Terrain:
def __init__(self, dimension, color):
# Game details
self._dimension = dimension... | mcelhennyi/PocketTanks | map/terrain.py | terrain.py | py | 7,206 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sprites.X",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "math.atan2",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "math.pi",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "sprites.Y",
"line_number": 61,
... |
40160397265 | # --------------------------------------------------------------------------
# ------------ Metody Systemowe i Decyzyjne w Informatyce ----------------
# --------------------------------------------------------------------------
# Zadanie 3: Regresja logistyczna
# autorzy: A. Gonczarek, J. Kaczmar, S. Zareba
# 201... | pavulonx/machine-learning-university-tasks | task-3-logistic-regression/utils.py | utils.py | py | 2,171 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "numpy.shape",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.floor",
"line_number": 2... |
11226302513 | import os
import json
import jieba.analyse
import threading
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse, QueryDict
from .models import Post, Comment, Photo, Favor, TextKey
from user.models import User
from django.views.decorators.csrf import csrf_exempt, csrf_protect
gen_resp... | ShiranZH/PKU-CAT | src/backend/pkucat/post/views.py | views.py | py | 18,169 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "django.http.JsonResponse",
"line_number": 68,
"usage_type": "call"
},
{
"api_na... |
25229640945 | __version__ = '1.0.2'
__title__ = 'dockerw'
__uri__ = 'https://github.com/kschwab/dockerw'
__author__ = 'Kyle Schwab'
__summary__ = 'Docker run wrapper script. Provides a super-set of docker run capabilities.'
__doc__ = __summary__
__copyright__ = 'Copyright (c) 2022-2023, Kyle Schwab'
__license__ = __copyright__ + '''... | kschwab/dockerw | dockerw/dockerw.py | dockerw.py | py | 36,405 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.getuid",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_n... |
11757426922 | import random
import scipy.stats
def get_bm_data(filename):
data = {}
with open(filename, 'r') as f:
f.readline()
line = f.readline()
for k in ('name', 'gender', 'age', 'division', 'country', 'time'):
data[k] = []
while line != '':
split = line.split(',... | zuzuqo/ossu | 1 Intro CS/02.Intro to CS/21.Randomized Trials and Hypothesis Checking/21.6.Mulriple Hypotheses/marathon.py | marathon.py | py | 2,296 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "scipy.stats.stats.ttest_ind",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "scipy.stats.stats",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "random... |
1177527746 | from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = patterns('',
url(r'^$', 'blog.views.home', name='home'),
url(r'^contents/$', 'blog.views.contents', name='contents'),
url(r'^post/... | nonZero/WonderSite | wondersite/urls.py | urls.py | py | 1,059 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.conf.urls.patterns",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.conf.urls.url",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dja... |
12296726291 | '''
This progam asks for a user file,
then takes the number values from the file and reads its contents
to determine different values. Made for homework 10
By: Saad'''
import os
import statistics
def main():
fileName = input("Please enter a full filename: ").strip()
if os.path.isfile(fileName):
inputFi... | Saad-iit/pythonprojects | homework10.py | homework10.py | py | 828 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "statistics.mean",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "statistics.median",
"... |
38690279842 | import collections
# --- Transitional code from Python 2 to Python 3 ---
# See https://github.com/benjaminp/six/blob/master/six.py
import sys
ADDON_RUNNING_PYTHON_2 = sys.version_info[0] == 2
ADDON_RUNNING_PYTHON_3 = sys.version_info[0] == 3
if ADDON_RUNNING_PYTHON_3:
text_type = str
binary_type = bytes
elif A... | Wintermute0110/plugin.program.AEL.dev | resources/const.py | const.py | py | 20,156 | python | en | code | 98 | github-code | 7 | [
{
"api_name": "sys.version_info",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.version_info",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.platform",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "collectio... |
35325662862 | import os
import numpy as np
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
import SimpleITK as sitk
import random
import torchvision.transforms.functional as tf
import cv2
import csv
import imageio
class ModelDataSet(Dataset... | Moeo3/nevertrustanyone | torch_code/seg_of_rectum/patch_and_label/dataset.py | dataset.py | py | 4,091 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "csv.reader",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_... |
6886165194 | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
#Plotting Histogram
data['Rating'].hist()
data = data[data['Rating']<=5]
data['Rating'].hist()
#Code ends here
# --------------
# code starts here
# Finding ... | Pannu22/ga-learner-dsmp-repo | Data-Preprocessing/code.py | code.py | py | 3,178 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "seaborn.catplot",
"lin... |
26037402304 |
import inspect
import collections
from pkg_resources import iter_entry_points
from rowgenerators.exceptions import RowGeneratorError
from appurl import parse_app_url, Url
def get_generator(source, **kwargs):
from rowgenerators import Source
names = []
if isinstance(source, Source):
return sour... | rkiyengar/rowgenerators | rowgenerators/core.py | core.py | py | 4,912 | python | en | code | null | github-code | 7 | [
{
"api_name": "rowgenerators.Source",
"line_number": 14,
"usage_type": "argument"
},
{
"api_name": "appurl.parse_app_url",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "inspect.isgenerator",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "col... |
38828204261 | import logging
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from db.database import get_db
from db import models
from auth.jwt_bearer import JWTBearer
import uuid
from datetime import datetime, date
import schemas
from dependencies.profiles import get_active_profile_by_id
fr... | NwaforAugustine321/ktizo-backend | router/licence.py | licence.py | py | 19,363 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "uuid.UUID",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sqlalchemy.orm.Session",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fastapi.Depen... |
11725918958 | # coding: utf-8
import bpy
from . import vertexarray
from .. import bl
from pymeshio import englishmap
class Morph(object):
__slots__=['name', 'type', 'offsets']
def __init__(self, name, type):
self.name=name
self.type=type
self.offsets=[]
def add(self, index, offset):
sel... | ousttrue/blpymeshio | exporter/oneskinmesh.py | oneskinmesh.py | py | 16,663 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "bpy.ops.object.modifier_apply",
"line_number": 364,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 364,
"usage_type": "attribute"
},
{
"api_name": "pymeshio.englishmap.skinMap",
"line_number": 448,
"usage_type": "attribute"
},
{
"ap... |
31664301120 | import json
import os
from datetime import datetime
from typing import Optional, Union
from aws_cdk import (
aws_lambda,
aws_secretsmanager as secretsmanager,
aws_rds as rds,
aws_ec2 as ec2,
Stack,
CustomResource,
custom_resources,
)
from constructs import Construct
class BootstrappedDb(... | developmentseed/cdk-bootstrapped-db | cdk_bootstrapped_db/constructs.py | constructs.py | py | 2,985 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "constructs.Construct",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "constructs.Construct",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "aws_cdk.aws_rd... |
22501448324 | import asyncio
from datetime import datetime
from channels.db import database_sync_to_async
from channels.generic.http import AsyncHttpConsumer
from channels.generic.websocket import AsyncJsonWebsocketConsumer
from .models import Chan, Message
class ChatConsumer(AsyncJsonWebsocketConsumer):
async def connect(se... | nim65s/tutochan | chat/consumers.py | consumers.py | py | 2,220 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "channels.generic.websocket.AsyncJsonWebsocketConsumer",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "models.Chan.objects.get_or_create",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "models.Chan.objects",
"line_number": 38,
"usage_t... |
30267860305 | """
Provides class for scanning ports
"""
from tools.common.port_scan_task import PortScanTask
from tools.masscan.base import MasscanBase
from tools.nmap.tool import NmapTool
from aucote_cfg import cfg
from utils.exceptions import StopCommandException
class MasscanPorts(PortScanTask):
"""
Scans for open port... | FCG-LLC/aucote | tools/masscan/ports.py | ports.py | py | 1,551 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tools.common.port_scan_task.PortScanTask",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tools.masscan.base.MasscanBase",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "aucote_cfg.cfg",
"line_number": 32,
"usage_type": "name"
},
{... |
41888945536 | #! /usr/bin/env python3
# _*_ coding: utf8 _*_
import os
import socket
import sys
from multiprocessing import shared_memory, active_children
from builtins import OSError
sharedMemorySize = 20
def create_tubes(path_tube_1, path_tube_2):
try:
os.mkfifo(path_tube_1, 0o0600)
os.mkfifo... | Wanadian/secured_programming_project | server/action.py | action.py | py | 1,929 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.mkfifo",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.mkfifo",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "builtins.OSError",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "sys.exit",
"line_number": 19... |
6326771630 | #Importamos los siguientes módulos que nos serán de utilidad para poder leer la información de la página web
import http.client
import json
headers = {'User-Agent': 'http-client'}
conn = http.client.HTTPSConnection("api.fda.gov") #Establecemos conexión con la página solicitada
conn.request("GET", "/drug/label.json?&l... | javipozo6/openfda | openfda-1/programa-2.py | programa-2.py | py | 1,109 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "http.client.client.HTTPSConnection",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "http.client.client",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "http.client",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "j... |
3625379387 | # Gan Ming Liang
# TP063338
# Amadea Lim Yi Wen (teammate)
# TP064038
# Program name: AEGIS (Asian Event General Interface Solution)
import datetime # import datetme from python library for later use
def homepage():
print("=== Welcome to Asian Event Management Service (AEMS) ===")
print("Pleas... | Dalton-G/aegis | aegis.py | aegis.py | py | 26,430 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.today",
"line_number": 553,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 553,
"usage_type": "attribute"
}
] |
11070766706 | from torch.utils.data import Dataset, DataLoader
import torch
from torchtext.datasets import BABI20
def dataloader(batch_size, memory_size, task, joint, tenK):
train_iter, valid_iter, test_iter = BABI20.iters(
batch_size=batch_size, memory_size=memory_size, task=task, joint=joint, tenK=tenK, device=torch.d... | Jimin9401/nlp_tasks | QA/end_2_end_memory_network/utils.py | utils.py | py | 1,841 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torchtext.datasets.BABI20.iters",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torchtext.datasets.BABI20",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "t... |
33234467718 | #!/usr/bin/env python
import category_encoders as ce
from pandas import concat, Series
from time import time
from pandas.core.frame import DataFrame
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import StandardScaler
from sklearn.compose import ColumnTransfor... | capac/predicting-earthquake-damage | helper_funcs/exploratory.py | exploratory.py | py | 6,790 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.hstack",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.resample",
"line_number": 36,
"usage_type": "call"
},
{
... |
25151039240 | import blenderproc as bproc
import dataclasses
import dcargs
import json
import numpy as np
import os
from PIL import Image
import shutil
from typing import Literal
import imageio
from blenderproc.python.camera.CameraUtility import get_intrinsics_as_K_matrix
# Object to shapenet id mappings
obj_to_shapenet_ids = {
... | kevin-thankyou-lin/active-3d-gym | scripts/blenderproc_offline_data.py | blenderproc_offline_data.py | py | 12,469 | python | en | code | 18 | github-code | 7 | [
{
"api_name": "typing.Literal",
"line_number": 60,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "typing.Literal",
"line_number": 73,
"usage_type": "name"
},
{
"api_name": "typing.Liter... |
31096291479 | import sys
input = sys.stdin.readline
from collections import deque
n, m = map(int, input().split())
d = {x+1:deque([0 for _ in range(20)]) for x in range(n)}
for _ in range(m):
o = list(map(int, input().split()))
if len(o) == 3:
d[o[1]][o[2]-1] = (o[0]-1)^1
elif o[0] == 3:
d[o[1... | dee021/CodingTest | 백준/Silver/15787. 기차가 어둠을 헤치고 은하수를/기차가 어둠을 헤치고 은하수를.py | 기차가 어둠을 헤치고 은하수를.py | py | 514 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.stdin",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 6,
"usage_type": "call"
}
] |
19137059944 | from LogRegression import MyLogisticRegression
from utils import loadData, zScoreNormalization, plotData
from sklearn import linear_model
import numpy as np
def accuracy(real, computed):
return sum([1 if real[i] == computed[i] else 0 for i in range(len(real))]) / len(real)
if __name__ == '__main__':
inputs,... | andrei-ardelean/Artificial-Intelligence | Machine Learning/Logistic Regression algorithm/main.py | main.py | py | 3,390 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.loadData",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.choic... |
71184792865 | import concurrent.futures
import re
import time
import xml.etree.ElementTree as ET
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
class NetworkHandler:
"""
Abstracts the creation of session with specific retry strategy and multithreading
"""
def __init... | Barabazs/archivooor | archivooor/archiver.py | archiver.py | py | 8,989 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "concurrent.futures.futures.ThreadPoolExecutor",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.futures",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "concurrent.futures",
"line_number": 18,
"usage_type": "name... |
9601792831 | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Team, Project
@admin.register(Team)
class TeamAdmin(admin.ModelAdmin):
list_display = (
'title',
'description',
'date_created',
'id',
'slug',
'published',
'reviewed',
't... | EngineerLogbook/scrum-2 | src/project/admin.py | admin.py | py | 811 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 7,
"usage_type": "call"
},
{
... |
28971863980 | from collections import deque # 덱 불러옴(BFS에 이용)
import sys
input = sys.stdin.readline
# DFS
def dfs(graph, v, visited): # graph(이차원리스트), 시작점, 방문처리여부리스트
visited[v] = True # 현재 노드를 방문처리
print(v, end=' ') # v를 출력하는데, 띄어쓰기를 해주면서 출력한다.
# 현재 노드와 연결된 다른 노드를 재귀적으로 방문
for i in graph[v]:
if not ... | wjsrlahrlco1998/Coding-Test-Study | KiiiimDong/[BOJ]_DFS와_BFS/[BOJ]_DFS와_BFS.py | [BOJ]_DFS와_BFS.py | py | 2,088 | python | ko | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 17,
"usage_type": "call"
}
] |
24172764159 | from selenium import webdriver
import sys
sys.path.append('./config')
import config as config
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from seleni... | piyush-esignature/mengedegna_automation | Super-admin/add_user.py | add_user.py | py | 2,679 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "selenium.webdri... |
11276742701 | '''
프로그래머스 팀에서는 기능 개선 작업을 수행 중입니다.
각 기능은 진도가 100%일 때 서비스에 반영할 수 있습니다.
또, 각 기능의 개발속도는 모두 다르기 때문에 뒤에 있는 기능이 앞에 있는 기능보다 먼저 개발될 수 있고,
이때 뒤에 있는 기능은 앞에 있는 기능이 배포될 때 함께 배포됩니다.
먼저 배포되어야 하는 순서대로 작업의 진도가 적힌 정수 배열 progresses와
각 작업의 개발 속도가 적힌 정수 배열 speeds가 주어질 때
각 배포마다 몇 개의 기능이 배포되는지를 return 하도록 solution 함수를 완성하세요.
'''
from coll... | choiwonho/wonos-python | programmers/programmers_stack_queue2.py | programmers_stack_queue2.py | py | 1,963 | python | ko | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "operator.add",
... |
74740875102 | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import, unicode_literals
import copy
import enum
import multiprocessing
from collections import Counter
from six import text_type
from six.moves import zip
from typepy import (
Bool,
Dat... | bestmethod/tcconfig-ubuntu-venv | lib/python3.6/site-packages/dataproperty/_extractor.py | _extractor.py | py | 21,210 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "enum.Enum",
"line_number": 47,
"usage_type": "attribute"
},
{
"api_name": "enum.unique",
"line_number": 46,
"usage_type": "attribute"
},
{
"api_name": "typepy.Bool",
"line_number": 135,
"usage_type": "name"
},
{
"api_name": "typepy.DateTime",
"l... |
8618143073 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from sqlalchemy.orm import sessionmaker
from hrforecast_test.models import (HRForecastJobs,
... | valerysid/HRForecast-Web-Crawling-Test | hrforecast_test/hrforecast_test/pipelines.py | pipelines.py | py | 3,363 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "hrforecast_test.models.db_connect",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "hrforecast_test.models.create_table",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 23,
"usage_type": "cal... |
16676417420 | import json
import torch
from torch.utils.data import Dataset
class QADataset(Dataset):
def __init__(
self,
file_name,
tokenizer,
split="train",
max_length=256,
truncate_promt=True,
train=True,
):
self.train = train
self.pairs = []
... | Myashka/CQA_RLHF | sft/data/QADataset.py | QADataset.py | py | 1,804 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.tensor",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "torch.ones",
"line... |
21484356635 | """Removed machine sub command."""
import argparse
import sys
from docknv.logger import Logger, Fore
def _init(subparsers):
cmd = subparsers.add_parser(
"machine", help="removed machine command, use `service` instead"
)
cmd.add_argument("args", nargs=argparse.REMAINDER)
def _handle(args):
... | sharingcloud/docknv | docknv/shell/handlers/machine.py | machine.py | py | 561 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.REMAINDER",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "docknv.logger.Logger.raw",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "docknv.logger.Logger",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": ... |
1571131295 | import argparse
import copy
import os
import os.path as osp
import time
import warnings
import mmcv
import torch
import torch.distributed as dist
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist, set_random_seed
from mmcv.utils import get_git_hash
from mmaction import __version__
f... | chris901003/DeepLearning | mmaction2/tools/train.py | train.py | py | 11,596 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mmcv.DictAction",
"line_number": 80,
"usage_type": "name"
},
{
"api_name": "os.environ",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
... |
4544544312 | ##
import pandas as pd
from datetime import timedelta
import re
df = pd.read_csv('Downloads/data_file (1).csv')
tstamp_df = pd.DataFrame(columns=['TIME STAMP'])
timestamps=[]
dic={'JAN':'01', 'FEB':'02', 'MAR':'03', 'APR':'04','MAY':'05','JUN':'06',
'JUL':'07','AUG':'08','SEP':'09','OCT':'10','NOV':'11','DEC':'12... | nishnareddy1/Data-Engineering | code_critiques/code-critique2.py | code-critique2.py | py | 3,541 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_... |
34382791060 | import wx
import os
import builtins
import csv
import DSV
import gettext
ID_IMPORT = wx.NewIdRef()
ID_EXPORT = wx.NewIdRef()
ID_ADD = wx.NewIdRef()
ID_REMOVE = wx.NewIdRef()
ID_HELP = wx.NewIdRef()
_ = gettext.gettext
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#
# CLASS DEFIINTION
... | capocchi/DEVSimPy | DiagramConstantsDialog.py | DiagramConstantsDialog.py | py | 9,313 | python | en | code | 41 | github-code | 7 | [
{
"api_name": "wx.NewIdRef",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "wx.NewIdRef",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "wx.NewIdRef",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wx.NewIdRef",
"line_number": 11... |
43622811788 | from myapp import myobj
from myapp import db
from myapp.forms import TopCities
from myapp.models import City
from flask import render_template, escape, flash, redirect
@myobj.route("/", methods=['GET', 'POST'])
def home():
title = "Top Cities"
name = "Vidhyut"
top_cities = City.query.all()
form = TopCi... | VidhyutG/HomeworkFlask | myapp/routes.py | routes.py | py | 737 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "myapp.models.City.query.all",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "myapp.models.City.query",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "myapp.models.City",
"line_number": 11,
"usage_type": "name"
},
{
"api_na... |
488930935 | import requests
url = 'http://choco.local.xxx.xxx.fr/service/rest/v1/assets'
def download(url,filename):
filename = filename.replace('/','.')
filename = filename+'.nupkg'
r = requests.get(url, allow_redirects=True)
open(filename, 'wb').write(r.content)
def getdatacontinuation(url,continuati... | vijaidjearam/chocolatey-export-assets | chocolatey-export-assets.py | chocolatey-export-assets.py | py | 1,444 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,
"usage_type": "call"
}
] |
25669281038 | from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from metrics.models import Currency
from tags.models import MetaDataMixin
# Create your models here.
class Priority(models.Model):
label = models.CharField(max_length=32, unique=True, blank=True, null=True)... | kylebruder/kbruder | qndbacklog/models.py | models.py | py | 4,013 | python | en | code | 0 | github-code | 7 | [
{
"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.CharField",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": ... |
71804938783 | import streamlit as st
import pandas as pd
import numpy as np
import time
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
st.write("Here's our first attempt at using data to create a table:")
st.write(pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [1... | Moises-mfg/Analise-exploratoria-blockchain-Bitcoin | dashboard.py | dashboard.py | py | 3,630 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "streamlit.write",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
... |
5315748576 | from utils import formatacao, validacao, Projeto, Tarefa
formatacao.cabecalho('Udemy - Projetos com Tarefas')
worksheet = list()
while True:
print('''
[1] - Cadastrar Projeto
[2] - Apagar Projeto
[3] - Mostrar Projetos
[4] - Sair
''', end='')
opcao = validacao.leiaInt('Escolha uma opçã... | talesritz/Learning-Python---Udemy-Course | 03.Udemy - Projeto com Tarefas.py | 03.Udemy - Projeto com Tarefas.py | py | 2,716 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "utils.formatacao.cabecalho",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "utils.formatacao",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "utils.validacao.leiaInt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "uti... |
24190692948 | # -*- coding: utf-8 -*-
"""
Understand the problem. We'll look at each variable and do a philosophical analysis about their meaning and importance for this problem.
Univariable study. We'll just focus on the dependent variable ('SalePrice') and try to know a little bit more about it.
Multivariate study. We'll try to u... | DataScientist1000/DataScienceProjects | House_Price_Predection/Code/EDA_House_Price.py | EDA_House_Price.py | py | 14,588 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv"... |
30426793521 | import sys
from concurrent import futures
import requests
class SimpleRequester:
def __init__(self, url: str, concurrent: int = 0) -> None:
self.url = url
self.concurrent = concurrent
def request(self):
def _exec(_url):
res = requests.get(_url)
print(res.text)
... | n4cl/simple_requester | simple_requester.py | simple_requester.py | py | 1,027 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "concurrent.futures",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": ... |
71894532063 | from django.core.validators import RegexValidator
from django.db import models
class Prospect(models.Model):
phone_regex = RegexValidator(
regex=r'^\+?1?\d{10,15}$',
message=
"Phone number must be at least 10 digits and at max 15 digits."
"It can start with +(country code)")
n... | kartoza/ford3 | django_project/ford3/models/prospect.py | prospect.py | py | 781 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.core.validators.RegexValidator",
"line_number": 6,
"usage_type": "call"
},
{
"a... |
70714492703 | import numpy as np
import pandas as pd
from tqdm import tqdm
import argparse
import sys
import random
import matplotlib.pyplot as plt
def Plot(history,l):
#history is the array which
#have all 1126 time's result
m = np.min(history)
M = np.max(history)
print(M,m)
counts = np.zeros(int(M-m+1))
for i in range(len(... | ChengDe1996/NTU-HTML | r08922a04_hw1/compare.py | compare.py | py | 682 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.min",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 21... |
35065539863 | import mock
from paasta_tools.eks_tools import load_eks_service_config
from paasta_tools.eks_tools import load_eks_service_config_no_cache
def test_load_eks_service_config_no_cache():
with mock.patch(
"service_configuration_lib.read_service_configuration", autospec=True
) as mock_read_service_configu... | Yelp/paasta | tests/test_eks_tools.py | test_eks_tools.py | py | 2,930 | python | en | code | 1,652 | github-code | 7 | [
{
"api_name": "mock.patch",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "mock.patch",
"line_number": 14,
... |
9738783767 | from flask import Blueprint, request, make_response, jsonify
import api.utils.globals as globals
authBP = Blueprint("authBP", __name__)
@authBP.route('/credentials', methods=['POST'])
def set_credentials():
try:
res = {"valid": False}
data = request.get_json(force=True)
print(data)
... | matrixorigin/mochila | mochila_proto/api/auth/auth_bp.py | auth_bp.py | py | 2,257 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "flask.Blueprint",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "api.utils.globals... |
36167337059 | from django.urls import path
from rest_framework.routers import DefaultRouter, SimpleRouter
from . import views
urlpatterns = [
# 列表视图的路由APIView
path(r'books/', views.BookListAPIView.as_view()),
# 详情视图的路由APIView
path(r'books/<int:pk>/', views.BookDetailAPIView.as_view()),
# 列表视图的路由GenericAPIView
... | problemssr/DRF | book/urls.py | urls.py | py | 1,435 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
31097033973 | import os
import numpy as np
from os import listdir
from matplotlib.image import imread
import matplotlib.pyplot as plt
class_names = ['road', 'sidewalk', 'building', 'wall', 'fence', 'pole', 'traffic light', 'traffic sign', 'vegetation',
'terrain', 'sky', 'person', 'rider', 'car', 'truck', 'bus'... | bberabi11/Multitask-Learning-of-Semantic-Segmentation-and-Monucular-Depth-Estimation-For-Autonomous-Driving | mtl/scripts/class_weights.py | class_weights.py | py | 2,233 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.image.imread",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "numpy.sum",
"... |
37869840603 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
from sklearn import preprocessing
import matplotlib.pyplot as plt
import seaborn as sns
import os
os.chdir('/Users/CLETUS/Projects/python/mun... | cletuzz00/insuranceclaimfraud | sat.py | sat.py | py | 2,999 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.chdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.p... |
37786652344 | import random
from datetime import datetime, timedelta
from pymongo import MongoClient
from typing import List, Dict
from PandlolCollection.constant import QUEUE, TIER, DIVISION
from PandlolCollection.Objects.LOLObject import LOLObject
class Summoner(LOLObject):
"""
Класс призывателя
"""
def __init_... | CrazyDi/PandlolCollection | PandlolCollection/Objects/Summoner.py | Summoner.py | py | 7,145 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PandlolCollection.Objects.LOLObject.LOLObject",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Dict",
"line_number": 18,
"usage_type": "name"
},
{
"api... |
11517608134 | import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
mdgxhome = os.environ.get("MDGXHOME")
if mdgxhome is not None:
library_dirs = [os.path.join(mdgxhome, 'lib'),]
include_dirs = [os.path.join(mdgxhome, 'include'),]
else:
amberhome = os.en... | hainm/pymdgx | setup.py | setup.py | py | 1,065 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
14367633400 | import json
from typing import Any
from decimal import Decimal
from uuid import UUID
from dataclasses import asdict, is_dataclass
import quart.json.provider
class LitecordJSONEncoder(json.JSONEncoder):
"""Custom JSON encoder for Litecord. Useful for json.dumps"""
def default(self, value: Any):
if is... | dolfies/patchcord | litecord/json.py | json.py | py | 1,286 | python | en | code | 39 | github-code | 7 | [
{
"api_name": "json.JSONEncoder",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "decimal.Decimal",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "uuid.UUID",
"lin... |
17582137818 | from datetime import datetime
from flask import Flask, render_template, redirect, url_for, request
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.sql import func
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://postgres:123@localhost/test_fil_bill'
db = SQLAlchemy(app)
class HotWa... | pavelFilin/FilBill | start.py | start.py | py | 2,464 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "... |
17326655070 | import cv2
import numpy as np
import argparse
import pandas as pd
edge_rate = 0.05
parser = argparse.ArgumentParser()
parser.add_argument('--imgfile', default='',type=str,
help = 'The file name of the orignial image file')
parser.add_argument('--txtfile', default='', type=str,
he... | JuhunC/2019-1-CECD4-O-n--6_Server | models/mask.py | mask.py | py | 1,592 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.