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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15412087448 | from django.shortcuts import render
from django.http import HttpResponse
from django.utils.translation import get_language
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required
from django.conf import settings
from . import Checksum
from paytm.models import Pa... | harishbisht/paytm-django | payments/paytm/views.py | views.py | py | 2,130 | python | en | code | 31 | github-code | 6 | [
{
"api_name": "django.http.HttpResponse",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.HOST_URL",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 16,
"usage_type": "name"
},
{
"... |
72357813309 | # ==============================================================================
# Main runner entry point for the project
# Implemented using SAGE math library
#
# Author: Malo RANZETTI
# Date: Spring 2023
# ==============================================================================
import os
import msidh
import ... | mrztti/M-SIDH | run.py | run.py | py | 5,043 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sidh.create_protocol",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "sidh.get_curve",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.std... |
31512974964 | import json
import requests
import constants
import tokens
def make_api_call(access_token, url, method, **kwargs):
response = method(
url=url,
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {access_token}",... | rjshearme/spotify_recently_added_playlist | api.py | api.py | py | 1,168 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tokens.get_access_token",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "constants.API_URL",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "cons... |
75066284348 | import torch
import logging
import pickle
from core.utils import scale_image, save_layer_image
from data import image_corruption
def evaluate(model, loader, args, perturbation=False, pSize=0, **kwargs):
objective_function= kwargs.get('objective_function', None)
device = kwargs['device']
if 'epoch' in kwar... | SMRhadou/UnrolledGlow | core/evaluation.py | evaluation.py | py | 1,612 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "data.image_corruption",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "core.utils.scale_image",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.norm",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pickle.dump",... |
24522571380 | import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms
# 定义客户端类
class Client:
def __init__(self, model, train_loader, test_loader, lr=0.1):
self.model = model
self.train_loader = train_loader
self.test_loader = test_loader
self.op... | huguangs/NIID-Bench-main-master | top-k/main.py | main.py | py | 4,358 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.optim.SGD",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.optim",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.functional.cross_entropy",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.n... |
70680835069 | from flask import Flask
from flask import render_template
import ffmpeg_streaming
from ffmpeg_streaming import Formats
import sys
app = Flask(__name__)
@app.route("/")
def streaming():
return render_template('streaming.html')
@app.route('/video')
def video_server():
video = ffmpeg_streaming.input('pexels_video.... | ifcassianasl/python_test_rtsp | main.py | main.py | py | 764 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "ffmpeg_streaming.input",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "ffmpeg_stream... |
11232494681 | from collections import defaultdict
ENTER = "Enter"
LEAVE = "Leave"
CHANGE = "Change"
ENTER_MESSAGE = "님이 들어왔습니다."
LEAVE_MESSAGE = "님이 나갔습니다."
class ChatRoom:
def __init__(self):
super().__init__()
def operation(result, command, chatRoom, nicknames, uid="", name=""):
if command == ENTER:
... | gatherheart/Solved_PS | KAKAO/2019_KAKAO_1.py | 2019_KAKAO_1.py | py | 1,378 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
}
] |
70276262907 | import torch
import time
import argparse
from importlib import import_module
import numpy as np
import utils
import train
parser = argparse.ArgumentParser(description='BertClassifier')
# parser.add_argument('--model', type=str, default='BertFc', help='choose a model')
# parser.add_argument('--model', type=str, defaul... | Jacquelin803/Transformers | BertClassifier/main.py | main.py | py | 2,007 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.__version__",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "importlib.import_module",
"line_number": 24,
"usage_type": "call"
},
{
"api_name":... |
779248836 | from dataclasses import dataclass
from typing import Annotated, List
from fastapi import Depends
from fastapi_pagination import Page
from fastapi_pagination.ext.sqlalchemy import paginate
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from config.db import get_db_session
from readconnec... | YeisonKirax/readconnect-back | src/readconnect/books/infrastructure/db/repository/books_repository.py | books_repository.py | py | 2,625 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Annotated",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "fastapi.Depends",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "... |
37562147384 | """helper
=============
Helper functions for inventory scripts.
"""
__author__ = "Balz Aschwanden"
__email__ = "balz.aschwanden@unibas.ch"
__copyright__ = "Copyright 2017, University of Basel"
__credits__ = ["Balz Aschwanden"]
__license__ = "GPL"
import json
import os
import socket
def get_hostname():
"""Ret... | ANTS-Framework/ants | antslib/inventory/helper.py | helper.py | py | 1,278 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "socket.gethostname",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
74796406586 | from torch.utils.tensorboard import SummaryWriter
from torchvision import transforms
import cv2
from PIL import Image
# 1、transform使用Totensor
img_path = "../dataset/train/ants/0013035.jpg"
img_PIL = Image.open(img_path)
tensor_trans = transforms.ToTensor()
img_tensor = tensor_trans(img_PIL)
# 2、tensor数据类型
writer = S... | ccbit1997/pytorch_learning | src/learn_transform.py | learn_transform.py | py | 1,344 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torchvision.tr... |
43168508245 | import asyncio
import json
import logging
import typing
from pathlib import Path
import discord
from discord.ext import commands
from fuzzywuzzy import process
from roycemorebot.constants import (
Categories,
Channels,
Emoji,
Guild,
MOD_ROLES,
StaffRoles,
)
log = logging.getLogger(__name__)
... | egelja/roycemorebot | roycemorebot/exts/subscriptions.py | subscriptions.py | py | 15,209 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands.Cog",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "... |
34787406936 | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from wordcloud_process import wordcloud_img
from article_loader import ArticleLoader
article_loader = ArticleLoader('english_corpora.yaml')
articles = article_loader.load()
def feature_and_matrix(arti... | is3ka1/NLP-Practice | week1/english_news_analyse.py | english_news_analyse.py | py | 1,252 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "article_loader.ArticleLoader",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "article_loader.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 12,
"usage_type": "call"
... |
25172905892 | #%%
import pandas as pd
import altair as alt
import numpy as np
from sklearn.neighbors import NearestNeighbors
alt.data_transformers.disable_max_rows()
#%%
RADICL_file="/home/vipink/Documents/FANTOM6/HDBSCAN_RADICL_peak/data/processed/chr16_filter_df.csv"
#%%
radicl_df = pd.read_csv(RADICL_file,delimiter="\t")
# Obser... | princeps091-binf/HDBSCAN_RADICL_peak | scripts/RADICL_read_neighbourhood.py | RADICL_read_neighbourhood.py | py | 2,053 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "altair.data_transformers.disable_max_rows",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "altair.data_transformers",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 11,
"usage_type": "call"
},
{
... |
35413595898 | # -*- coding:utf-8 -*-
import random
import pygame
class BoardManager:
WALL = 0
FOOD = 1
NONE = 2
HEAD = 3
BODY = 4
def __init__(self, x_blocks, y_blocks, block_width, origin_x, origin_y, caption):
self.x_blocks = x_blocks
self.y_blocks = y_blocks
# NONE的方块
sel... | coderwf/pygames | glutsnake/board.py | board.py | py | 4,748 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "pygame.dis... |
9580721700 | """
Tomasulo main module.
"""
import argparse
import logger
from machine import Machine
def main():
"""
Main entry point.
Parses command line argument and begins execution.
:return: None
"""
parser = argparse.ArgumentParser(description='Simulate execution of DLX code on a Tomasulo processor.... | kaledj/TomasuloSim | tomasulo.py | tomasulo.py | py | 751 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "logger.setLogLevel",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "machine.Machine",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "machine.lo... |
5489764282 | """
Module that provides different readers for trajectory files.
It also provides a common interface layer between the file IO packages,
namely pygmx and mdanalysis, and mdevaluate.
"""
from .checksum import checksum
from .logging import logger
from . import atoms
from functools import lru_cache
from collections impo... | mdevaluate/mdevaluate | mdevaluate/reader.py | reader.py | py | 12,347 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "warnings.catch_warnings",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "warnings.simplefilter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "MDAnalysis.Universe",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "num... |
8909257357 | import numpy as np
import cv2
import os
from PIL import Image
X = 10 # 0
Y = 105 # 95
WIDTH = 215 # 356
HEIGHT = 440 # 440
def process_img(original_img):
processed_img = cv2.cvtColor(original_img, cv2.COLOR_BGR2GRAY)
processed_img = cv2.resize(processed_img, (10, 20))
return processed_img
def grab_screen... | sebastianandreasson/tetris_tensorflow | grab_screen.py | grab_screen.py | py | 671 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.cvtColor",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "cv2.resize",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
... |
3721769844 | import io
import time
from openpyxl import Workbook
import openpyxl as O
import speedtest
import re
import sys
import psycopg2
from psycopg2 import Error
from datetime import datetime
import hashlib
from .connection import Connection
cn=Connection()
class SpeedPage():
def asking_name(self):
print("Введите ваше ИМЯ... | Astarota/SpeedTestCLI | pages/speed_page.py | speed_page.py | py | 3,737 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "connection.Connection",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "psycopg2.connect",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "connection.cursor",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "psycopg2.Err... |
6748902164 | import cv2
import numpy as np
import face_recognition
import os
from datetime import datetime
import keyboard
import os
import pandas as pd
train_data_path = os.path.join('artifacts', "attendance.csv")
os.makedirs(os.path.dirname(train_data_path), exist_ok=True)
columns =['Name','Time']
test = []
train = pd.DataFrame(... | aruneer007/attendance | face.py | face.py | py | 2,859 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_num... |
6159961636 | import json
a = {
"name": "ivo",
"age": "22"
}
def serialize_to(path, data):
json_string = json.dumps(a, indent=4)
with open(file, "w") as f:
f.write(json_string)
def unserialize_from(path):
with open(path, "r") as f:
contents = f.read()
return json.loads(contents)
| Vencislav-Dzhukelov/101-3 | week3/3-Panda-Social-Network/panda_json.py | panda_json.py | py | 316 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 19,
"usage_type": "call"
}
] |
35492004084 | from ninja import Router
from ninja import NinjaAPI, File
from ninja.files import UploadedFile
from django.http import HttpResponse
from RECOGNIZE.text_reader import OCR_Reader
import io
import PIL.Image as Image
import cv2
import os
import time
import json
import uuid
import requests
router = Router()
path = __file__... | fakhrilak/image_recognize | RECOGNIZE/index.py | index.py | py | 2,687 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ninja.Router",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "ninja.files.UploadedFile",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "ninja.File",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
... |
5446974377 | import numpy as np
import scipy as sp
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm
def func2(x):
return np.round(np.random.random())
def func(x,y,z,r):
l = np.linalg.norm(np.array([x,y,z]))
if(l < r):
return 1.0
else:
return 0.0
def normalize_signal_1d(... | mcastrorib/bergman_periodic_solution | python/fft_test.py | fft_test.py | py | 9,440 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.round",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "numpy.linalg.norm",
... |
18101264424 | from typing import List, Tuple
from unittest import TestCase, main
class Solution:
def longestPalindrome(self, s: str) -> str:
def func(left: int, right: int, longest: str) -> str:
"""returns the longest palindromic substring using left and right index"""
longest_length = len(longe... | hirotake111/leetcode_diary | leetcode/longest_palindromic_substring/solution.py | solution.py | py | 1,187 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "unittest.TestCase",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "unittest.main",
"line_... |
35010781963 | from grafo.Grafo import *
from collections import deque
class EdmondsKarp:
def __init__(self, grafo: Grafo) -> None:
self.grafo = grafo
self.fluxo = {arco: 0 for arco in self.grafo.arcos.values()}
self.fluxo = {}
for arco in self.grafo.arcos.values():
self.fluxo[(arco.v... | jdanprad0/INE5413-Grafos | Atividade-03-Grafos/algoritmos_t3/edmondsKarp/EdmondsKarp.py | EdmondsKarp.py | py | 2,190 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "grafo.Grafo",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.deque",
"line_number": 22,
"usage_type": "call"
}
] |
35416632908 | import logging
import battle.main
import memory.main
import screen
import xbox
FFXC = xbox.controller_handle()
logger = logging.getLogger(__name__)
def yojimbo(gil_value: int = 263000):
logger.info("Yojimbo overdrive")
screen.await_turn()
memory.main.wait_frames(6)
if not screen.turn_aeon():
... | coderwilson/FFX_TAS_Python | battle/overdrive.py | overdrive.py | py | 723 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "xbox.controller_handle",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "screen.await_turn",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "memory.main... |
8385108161 | from __future__ import absolute_import
from __future__ import print_function
import argparse
from lxml import etree
parser = argparse.ArgumentParser(
description='Create tls links from sumo net as needed by tls_csv2SUMO.py. You have to edit the link number ' +
'field (preset with g). The comment gives the lin... | ngctnnnn/DRL_Traffic-Signal-Control | sumo-rl/sumo/tools/tls/createTlsCsv.py | createTlsCsv.py | py | 1,181 | python | en | code | 17 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "lxml.etree.parse",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 14,
"usage_type": "name"
}
] |
13974817829 | from pydantic import BaseModel, Field
from typing import List, Union
import pydantic
from .validators import validate_polygon, validate_is_plane_orthogonal_to_polygon, validate_plane_normal_is_not_zero
class Point3DModel(BaseModel):
__root__: List[float] = Field(..., min_items=3, max_items=3)
class PlaneModel... | mikheev-dev/polygon_splitter | src/data_model.py | data_model.py | py | 2,164 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "pydantic.Field",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pydantic.BaseModel",
... |
33551925024 | import requests as rq
from dotenv import load_dotenv
import os
import smtplib
import sys
class FPL:
URL = 'https://fantasy.premierleague.com/api/bootstrap-static/'
def __init__(self):
self.response_raw = rq.get(FPL.URL)
load_dotenv()
self.email_sent = os.getenv('EMAIL_SENT')
... | FilleDille/fpl_reg_chaser | main.py | main.py | py | 1,966 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "dotenv.load_dotenv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_numbe... |
5480419217 | import os
import requests
from bs4 import BeautifulSoup
import re
import time
import sys
user_agent = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36'
def get_music_data(url):
"""
用于获取歌曲列表中的歌曲信息
"""
headers = {'User-Agent':user_agent}
... | haochen1204/Reptile_WYYmusic | 网易云爬虫.py | 网易云爬虫.py | py | 3,336 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_numb... |
39868308641 | from django.db import models
from main.model.playlist import Playlist
from main.model.track import Track
class PlaylistTracks(models.Model):
playlist = models.ForeignKey(
Playlist, on_delete=models.CASCADE
) # при удалении плейлиста чистится кросс-таблица
track = models.ForeignKey(
... | artemgv/spacemusic | app/main/model/playlisttracks.py | playlisttracks.py | py | 992 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.db.models.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": ... |
73573186747 | import requests
addresses = {
"TXA2WjFc5f86deJcZZCdbdpkpUTKTA3VDM": "energyRateModelContract",
"TSe1pcCnU1tLdg69JvbFmQirjKwTbxbPrG": "sTRXImpl",
"TU3kjFuhtEo42tsCBtfYUAZxoqQ4yuSLQ5": "sTRXProxy",
"TNoHbPuBQrVanVf9qxUsSvHdB2eDkeDAKD": "marketImpl",
"TU2MJ5Veik1LRAgjeSzEdvmDYx7mefJZvd": "marketProxy",
}
json_ori =... | dpneko/pyutil | contract_whitelist.py | contract_whitelist.py | py | 733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 28,
"usage_type": "call"
}
] |
37555045718 | # Low-Dose CT with a Residual Encoder-Decoder Convolutional Neural Network (RED-CNN)
# https://arxiv.org/ftp/arxiv/papers/1702/1702.00288.pdf
# reference https://github.com/SSinyu/RED-CNN
import os
import numpy as np
import torch.nn as nn
from model import common
def make_model(args, parent=False):
return REDCNN(... | stefenmax/pytorch-template-medical-image-restoration | src-v3/model/redcnn.py | redcnn.py | py | 2,084 | python | en | code | 6 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
5384553044 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import os
__DIR__ = os.path.abspath(os.path.dirname(__file__))
from ply import lex, yacc
from .data import Domain, MsgId, MsgStr, MsgStrPlural, MsgStrList, Message
class ParserException(Exception):
pass
DEB... | takada-at/ponda | ponda/parser.py | parser.py | py | 5,662 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "data.Domain",
"line_num... |
31211285971 | ''' TAREA5
Determina el tamaño de muestra requerido por cada lugar decimal
de precisión del estimado obtenido para el integral, comparando
con Wolfram Alpha para por lo menos desde uno hasta siete decimales;
representa el resultado como una sola gráfica o de tipo caja-bigote
o un diagrama de... | Elitemaster97/Simulacion | Tarea5/Tarea5.1.py | Tarea5.1.py | py | 3,447 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "math.pi",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "math.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.vectorize",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 16... |
35279730803 | from flask import Flask, url_for, render_template, request, flash, redirect, session, abort, jsonify
import RPi.GPIO as GPIO
import subprocess, os, logging
import ipdb
from config import Config
from time import sleep
'''initial VAR'''
# Light GPIO
RELAIS_4_GPIO = 2
# Water GPIO
RELAIS_WATER_GPIO = 22
logging.basicCo... | oldgiova/python-api-webservice-lightscontrol | main.py | main.py | py | 3,747 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "config.Config",
... |
17176402024 | import datetime
import h5py
import librosa
import numpy as np
import os
import pandas as pd
import soundfile as sf
import sys
import time
import localmodule
# Define constants.
data_dir = localmodule.get_data_dir()
dataset_name = localmodule.get_dataset_name()
orig_sr = localmodule.get_sample_rate()
negative_labels ... | BirdVox/bv_context_adaptation | src/001_generate-audio-clips.py | 001_generate-audio-clips.py | py | 6,126 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "localmodule.get_data_dir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "localmodule.get_dataset_name",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "localmodule.get_sample_rate",
"line_number": 17,
"usage_type": "call"
},
{
... |
30039234138 | from django.views.decorators.http import require_http_methods
from django.http import JsonResponse
from django.http import HttpResponse
from .service.login import Login
from .service.report import uploadData
from .service.getdata import getRoadMap
import json
# Create your views here.
@require_http_methods(["GET",... | luzy99/road_smoothness_detection | road_detect_server/my_server/wx/views.py | views.py | py | 1,542 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.http.JsonResponse",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.http.require_http_methods",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "service.login.Login",
"line_number": 35,
"usage_type": "call"
... |
14279541024 | from collections import defaultdict
from intcode.intcode import read_program, VM
import matplotlib.pyplot as plt
DIRECTION_LEFT = (-1, 0)
DIRECTION_RIGHT = (1, 0)
DIRECTION_UP = (0, -1)
DIRECTION_DOWN = (0, 1)
TURN_LEFT = 0
TURN_RIGHT = 1
COLOR_BLACK = 0
COLOR_WHITE = 1
next_direction_left = {
DIRECTION_UP: DI... | bwdvolde/advent-of-code-2019 | day11/solution.py | solution.py | py | 2,178 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "intcode.intcode.VM",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "... |
25205799104 | # -*- coding: utf-8 -*-
"""
Abstract class for detectors
"""
import abc
class Embedder(abc.ABC):
@abc.abstractmethod
def embed(self):
'Return embed features'
return NotImplemented
@abc.abstractmethod
def get_input_shape(self):
'Return input shape'
return NotI... | chunhanl/ElanGuard_Public | src/face_reid/embedders.py | embedders.py | py | 10,556 | python | en | code | 13 | github-code | 6 | [
{
"api_name": "abc.ABC",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.flip... |
21107944564 | from classification.image_to_array import imageTonpv
from classification.cnn_class import cnn_class
import csv
from os import listdir
from os.path import isfile, join
import cv2
import numpy as np
def finalReport(label_ids = [], cids_test = [], class_count=[], class_viability =[], path = '', model='' ):
v... | chenxun511happy/Cartilage-Net | classification/ClassifyMain.py | ClassifyMain.py | py | 5,545 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "time.strftime",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "os.path.isfile",
"line_number... |
26969763906 | import os
from utils.util import make_dir_under_root, read_dirnames_under_root
OUTPUT_ROOT_DIR_NAMES = [
'masked_frames',
'result_frames',
'optical_flows'
]
class RootInputDirectories:
def __init__(
self,
root_videos_dir,
root_masks_dir,
video_names_filename=None
... | amjltc295/Free-Form-Video-Inpainting | src/utils/directory_IO.py | directory_IO.py | py | 2,029 | python | en | code | 323 | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "utils.util.read_dirnames_under_root",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "utils.u... |
29272947400 | import pymongo
import json
from pymongo import MongoClient
from bson import json_util
def StatImages():
client = MongoClient('mongodb://0.0.0.0:27017/')
db = client['diplom_mongo_1']
posts = db.posts
data = posts.find({"type": "image"})
count = 0
weight = 0
copies = 0
copiesId = {}
copiesIdList = []
imgForma... | dethdiez/viditory_analyzer | api/stat.py | stat.py | py | 964 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 7,
"usage_type": "call"
}
] |
14351509220 |
import mercantile
def get_blank_feature_json(lat, lon):
ft_dict = {"type": "Feature"}
geom_dict = {"type": "Point", "coordinates": [lon, lat]}
ft_dict["geometry"] = geom_dict
return ft_dict
# GET QUADHASH TILE OF A GIVEN COORDINATE
def get_quad_tile(lat, lon, precision):
ret = mercantile.tile(l... | InsertCoolNameHere/Quby | geo_utils/quadtile_utils.py | quadtile_utils.py | py | 2,812 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mercantile.tile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "mercantile.quadkey",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mercantile.quadkey_to_tile",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "mercant... |
37970241909 | import cv2
import numpy as np
#frame = np.full((360, 480, 3), 0, dtype=int)
frame = cv2.imread("/home/pi/Pictures/2020-07-20_1439.jpg")
cv2.imshow("Frame", frame)
while True:
key = cv2.waitKey(1)
if key != -1:
print("Key", key)
if key == ord("q"): # up key
break
| webbhm/FlaskExperiment | python/test_key.py | test_key.py | py | 295 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.waitKey",
"line_number": 9,
"usage_type": "call"
}
] |
74306420987 | from dataclasses import dataclass
from sqlalchemy import (Boolean, Column, DateTime, ForeignKey, Integer,
MetaData, Numeric, String, Table, create_engine)
metadata = MetaData()
@dataclass
class IOLModel:
sql_path: str
def __post_init__(self):
self.metadata = MetaData()
... | fscorrales/apys | src/apys/models/iol_model.py | iol_model.py | py | 7,935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Co... |
25585522305 | import os
import requests
import re
import yaml
from packaging import version
# Update the avalanchego_vms_list variable in roles/node/vars
# with new VM versions available and their compatibility with AvalancheGo
GITHUB_RAW_URL = 'https://raw.githubusercontent.com'
GITHUB_API_URL = 'https://api.github.com'
VARS_YAM... | AshAvalanche/ansible-avalanche-collection | scripts/update_vm_versions.py | update_vm_versions.py | py | 2,832 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number... |
28923395310 | from enums import PositionX, PositionY
from constants import AmmoIndicator as Properties
from functions import get_surface
from models.GameObject import PositionalGameObject
import pygame as pg
class AmmoIndicator(PositionalGameObject):
GROUP_NAME = 'ammo_indicator'
def __init__(self, scene, *groups, positio... | Thavin2147483648/shoot_platform | objects/AmmoIndicator.py | AmmoIndicator.py | py | 1,946 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.GameObject.PositionalGameObject",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "enums.PositionX.RIGHT",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "enums.PositionX",
"line_number": 11,
"usage_type": "name"
},
{
"... |
6757765764 | from django.shortcuts import render
import subprocess
def index(request):
if request.method == "POST":
link = request.POST["link"]
cont = request.POST["cont"]
# Baixa o torrent
subprocess.run(["transmission-cli", "-w", "./", link])
# Converte arquivos para MP4
subp... | SrTristeSad/Download-torrent | views.py | views.py | py | 1,169 | python | vi | code | 0 | github-code | 6 | [
{
"api_name": "subprocess.run",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.run",
"li... |
21071664643 | from dataclasses import dataclass
from typing import Union
import numpy as np
from matplotlib import pyplot as plt
@dataclass
class SpeakerSegment:
start: int = 0
end: Union[int, None] = None
@dataclass
class SplitStuff4Tw:
threshold_value: float
split_index: int
class CustomSegmentationStrategy:... | centre-for-humanities-computing/Gjallarhorn | data_processing/custom_segmentation.py | custom_segmentation.py | py | 5,069 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
... |
72612614909 | """trt_face_detection.py
This script demonstrates how to do real-time face detection with
TensorRT optimized retinaface engine.
"""
import os
import cv2
import time
import argparse
import pycuda.autoinit # This is needed for initializing CUDA driver
from utils.camera import add_camera_args, Camera
from utils.displa... | d246810g2000/tensorrt | face_recognition/trt_face_detection.py | trt_face_detection.py | py | 3,588 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.camera.add_camera_args",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "cv2.ge... |
32124013729 |
import os
from gpt_interaction import process_content_with_gpt
from web_scraping import scrape_web_content
from utils import read_file, convert_pdf_to_text, convert_docx_to_text, convert_excel_to_csv
def process_files(input_dir, tmp_dir, output_dir):
for root, dirs, files in os.walk(input_dir):
for file i... | vontainment/v-openai-data2json | file_handling.py | file_handling.py | py | 1,643 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "utils.convert_pdf_to_text",
"lin... |
43464163341 |
from datetime import timezone
import datetime
import pytz
from .send_mail_view import SendMailView
from django.test import RequestFactory
import pytest
class TestSendMailView:
# Test that sending an email with correct parameters returns a 200 OK response.
def test_send_mail_with_correct_parameters(self)... | segpy/technical-tests | prote/drf-prote-test/apps/prote_test/views/test_send_mail_view.py | test_send_mail_view.py | py | 2,162 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "send_mail_view.SendMailView",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "send_mail_view.SendMailView",
"line_number": 26,
"usage_type": "call"
},
{
... |
12177475498 | from django.urls import path
from . import views
urlpatterns = [
path('', views.homepage, name='home'),
path('id<int:id>', views.profile, name='profile'),
path('friends<int:user_id>', views.FriendsView.as_view(), name='friends'),
path('edit', views.edit_profile, name='edit_profile'),
path('friendship_request/<in... | synchro123/LetsTalk | social/apps/main/urls.py | urls.py | py | 2,226 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
19773599717 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
Runs IBIES gui
"""
from __future__ import absolute_import, division, print_function
import multiprocessing
import utool as ut
import ibeis # NOQA
import sys
CMD = ut.get_argflag('--cmd')
# For Pyinstaller
#from ibeis.all_imports import * # NOQA
def dependencie... | smenon8/ibeis | ibeis/__main__.py | __main__.py | py | 5,256 | python | en | code | null | github-code | 6 | [
{
"api_name": "utool.get_argflag",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "importlib.import_module",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "utool.get_cmdline_varargs",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "i... |
70779220668 | import math
import os
import re
from ast import literal_eval
from dataclasses import dataclass
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from accelerate.logging import get_logger
from accelerate.utils import is_tpu_available
from sklearn.metrics import accuracy_score, average_precision_... | starmpcc/REMed | src/utils/trainer_utils.py | trainer_utils.py | py | 11,900 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "accelerate.logging.get_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "re.findall",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.fin... |
42206728289 | import torch
from torch import nn
from torch.autograd import Variable
import torch.functional as F
from torch.optim import Adam
from torchvision.models import resnet50
# self
from vis import Vis
import vars
from data_loader import get_data_loader
from test import test
def train(epoch, model, train_loader, criterion, o... | DragonChen-TW/2018_bba_race | model/train.py | train.py | py | 1,970 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.autograd.Variable",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.autograd.Variable",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "vis.update_train",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torc... |
21681869620 | from datetime import date
from time import sleep
ano=int(input('Que ano quer analisar? Colo que 0 para analisar o ano atual:'))
print('Processando...')
sleep(2)
###################################################################################
if(ano==0):
ano=date.today().year
if((ano % 4 == 0) and (ano % 100 != 0... | VitorFidelis/Exercicios-Python | Desafio032.py | Desafio032.py | py | 448 | python | gl | code | 2 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 8,
"usage_type": "name"
}
] |
72532883389 | """
Multi-scale rabbit cardiac electrophysiology models
Rabbit Soltis-Saucerman model with full b-AR signalling (Rabbit SS 1D cardiac)
$ cd examples
$ make install-ci
$ make .env
SEE https://sparc.science/datasets/4?type=dataset
"""
import os
import sys
import time
from pathlib import Path
from time import sleep
f... | ITISFoundation/osparc-simcore | tests/public-api/examples/rabbit_cardiac_ss1d.py | rabbit_cardiac_ss1d.py | py | 4,184 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "osparc.__version__",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "dotenv.load_dotenv... |
7239186990 | import cv2 as cv
import numpy as np
import imutils
path = "/home/pks/Downloads/Assignment/IVP/mini project/"
def orientation(image):
'''
Rotate the image before any operation
based on the pos. of roll no. box w.r.t number table
'''
row, col = image.shape[:2]
thresh = cv.Canny(image, 40, 90)
... | pritamksahoo/III-IV-YEAR-Assignments | IVP/extract_ROI.py | extract_ROI.py | py | 8,042 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "cv2.Canny",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cv2.dilate",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.findContours",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.RETR_EXTERNAL",
"line_n... |
71781169789 | # Calculate FPS (Frames per second)
import cv2
from timeit import default_timer as timer
camera = cv2.VideoCapture(0)
frame_count = 0
total_time = 0
while camera.isOpened():
start_time = timer()
_, frame = camera.read()
frame_count += 1
elapsed_time = timer() - start_time
total_time += elapsed_ti... | yptheangel/opencv-starter-pack | python/basic/calculate_FPS.py | calculate_FPS.py | py | 596 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "timeit.default_timer",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow"... |
30367005261 | from traits.api import Any, Enum, Int, Property, Union
from enable.api import NativeScrollBar
from .chaco_traits import Optional
class PlotScrollBar(NativeScrollBar):
"""
A ScrollBar that can be wired up to anything with an xrange or yrange
and which can be attached to a plot container.
"""
# T... | enthought/chaco | chaco/plotscrollbar.py | plotscrollbar.py | py | 8,287 | python | en | code | 286 | github-code | 6 | [
{
"api_name": "enable.api.NativeScrollBar",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "traits.api.Enum",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "traits.api.Property",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "traits.... |
9920081347 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("new_listing", views.new_listing, name="new... | SaraRayne/Commerce | commerce/auctions/urls.py | urls.py | py | 862 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
25090333654 | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, zSize=10):
super(Model, self).__init__()
self.zSize = zSize
def create(self, opts):
self.scale_factor = 8 / (512 / opts.imsize)
self.nLatentDims = opts.nLatentDims
... | TylerJost/learnPytorch | autoencoders/aaeGaudenz.py | aaeGaudenz.py | py | 3,140 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
71366123387 | #!/usr/bin/env python
#-*-coding: utf-8 -*-
import numpy as np
import numpy.linalg as LA
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
def plot_regret(rewards, bestRewards, label, filename):
sumRewards = np.cumsum(rewards)
sumBestRewards = np.cumsum(bestRewards)
regret = (s... | jeppe/Adaptive-Social-Search | linucb/plot_utils.py | plot_utils.py | py | 1,894 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "matplotlib.use",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
... |
2061507228 | from sklearn.preprocessing import OneHotEncoder
import numpy as np
class CategoricalEncoder:
""" if scikit >= 0.20, better use scikit's version instead of this class """
def __init__(self, dense=True):
assert dense, "only dense output is supported"
def fit(self, X):
self._str_to_int = {}
... | rom1mouret/cheatmeal | benchmarks/preproc/categorical_encoder.py | categorical_encoder.py | py | 1,011 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.empty",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.int32",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "nump... |
11812216467 | from typing import Optional
import torch
import torch.nn as nn
class JaccardLoss(nn.Module):
"""JaccardLoss optimize mIoU score directly.
Args:
num_classes (int): A number of unique classes.
ignore_index (Optional[int]): Class label to ignore calculating score.
eps (float): Used to pr... | yutayamazaki/semantic-segmentation-pytorch | src/losses/jaccard.py | jaccard.py | py | 1,507 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_... |
20175364599 | from decimal import Decimal
from django.conf import settings
from django.urls import reverse
from django.shortcuts import render, get_object_or_404
from core.models import Player, Developer, Payment, Order
from django.views.decorators.csrf import csrf_exempt
from hashlib import md5
from payments.forms import PaymentFor... | vaarnaa/TheBestGameStore | payments/views.py | views.py | py | 4,464 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.get_object_or_404",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "core.models.Payment",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "decimal.Decimal",
"line_number": 29,
"usage_type": "call"
},
{
"api_na... |
40466717976 | import sys
from collections import deque
input = sys.stdin.readline
graph = []
for i in range(8):
graph.append(list(input().rstrip()))
answer = 0
def bfs():
direction = [[0,0],[0,-1],[0,1],[-1,0],[1,0],[-1,-1],[1,-1],[1,1],[-1,1]]
visited = [[0] * 8 for _ in range(8)]
dq = deque([7,0,0])
| Cho-El/coding-test-practice | 백준 문제/BFS/16954_움직이는 미로 탈출.py | 16954_움직이는 미로 탈출.py | py | 311 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "collections.deque",
"line_number": 13,
"usage_type": "call"
}
] |
71889266427 | import json
import sys
max_buy = float('-inf')
min_sell = float('inf')
for line in sys.stdin:
rec = json.loads(line.strip())
if 'price' not in rec:
continue
if rec['side'] == 'sell':
min_sell = min(min_sell, float(rec['price']))
else:
max_buy = max(max_buy, float(rec['price']))... | fivetentaylor/intro_to_programming | coinbase/format_wss_feed.py | format_wss_feed.py | py | 383 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.stdin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 7,
"usage_type": "call"
}
] |
17772360699 | import streamlit as st
import pandas as pd
import numpy as np
import psycopg2
from streamlit_option_menu import option_menu
#------- PAGE SETTINGS------------
page_title = "GHG Emission Calculator"
Page_icon = "🌳"
layout = "centered"
#-----------------------------------
st.set_page_config(page_title=page_tit... | sforson14/Data | myfile.py | myfile.py | py | 3,457 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.set_page_config",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "streamlit.title",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "streamli... |
8413183584 | # %% markdown
## Experiment 3 Trials
# %%
import numpy as np
import fire
import random
import pandas as pd
import json
from itertools import product
from markdown import markdown
import textwrap
from copy import deepcopy
import os, sys, json, pprint
from vgc_project.gridutils import transformations, getFeatureXYs
# %%... | markkho/value-guided-construal | experiments/exp3/generate_trials.py | generate_trials.py | py | 25,424 | python | en | code | 20 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "markdown.markdown",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "markdown.markdown",
"... |
38961213741 | import functools
class Person:
def __init__(self,Eid,Ename,Desig,sal):
self.Eid=Eid
self.Ename=Ename
self.Desig=Desig
self.sal=int(sal)
def PrintValues(self):
print("Emp Id",self.Eid)
print("Emp name",self.Ename)
print("Emp Degnation",self.Desig)
p... | Aswin2289/LuminarPython | LuminarPythonPrograms/Oops/empSalReduce.py | empSalReduce.py | py | 945 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "functools.reduce",
"line_number": 34,
"usage_type": "call"
}
] |
17335569332 | import pygame
import math
import random
class Bullet():
def __init__(self, health, direction, start, colour, rRange):
self.dims: tuple((int, int)) = (20, 20)
self.sprite = pygame.Surface((20, 20))
self.sprite.fill(colour)
self.sprite.set_colorkey(colour)
self.x, self.y = s... | andrewchu16/untitledproject | src/bullet.py | bullet.py | py | 1,225 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "pygame.Surface",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "pygame.draw.rect",
"line_num... |
39784628011 | from unittest.mock import Mock
import pytest
from juju.action import Action
from juju_verify.utils.action import data_from_action
@pytest.mark.parametrize(
"data, key, exp_value",
[
({"results": {"host": "compute.0", "test": "test"}}, "host", "compute.0"),
({"results": {"test": "test"}}, "ho... | canonical/juju-verify | tests/unit/utils/test_action.py | test_action.py | py | 746 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "unittest.mock.Mock",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "juju.action.Action",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "juju_verify.utils.action.data_from_action",
"line_number": 23,
"usage_type": "call"
},
{
"a... |
5061101951 | from ctypes import c_int, create_string_buffer
import json
import platform
if platform.system() == "Linux" :
from ctypes import cdll
else :
from ctypes import windll
ID_TIPO_COMPROBANTE_TIQUET = c_int( 1 ).value # "83" Tique
ID_TIPO_COMPROBANTE_TIQUE_FACTURA = c_int( 2 ).value # "81"... | martin-ramos/epsonfiscalproxy | epsonproxy.py | epsonproxy.py | py | 21,977 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "ctypes.c_int",
"line_num... |
36222363296 | # -*- coding: utf-8 -*-
import typing as T
import polars as pl
from ..importer import (
TsvGzReader,
dataframe_to_list_table,
)
from ..images import icon_by_portal, image_by_map
from .go_cmd import with_teleport_command
if T.TYPE_CHECKING:
from rstobj import Image, ListTable
def lt_list_main_city_gps_a... | MacHu-GWU/wotlkdoc-project | wotlkdoc/docs/gps/main_city.py | main_city.py | py | 1,226 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "importer.TsvGzReader",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "polars.col",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "polars.col"... |
42368009926 | from django.contrib import admin
from sign.models import Event, Guest
# Register your models here.
# EventAdmin类继承admin.ModelAdmin,admin.ModelAdmin类是一个自定义工具,能够自定义一些模块的特征
class EventAdmin(admin.ModelAdmin):
# list_display:用于定义显示哪些字段,必须是Event类里定义的字段
list_display = ['id', 'name', 'status', 'address', 'start_time']... | nhan118/learn | guest/sign/admin.py | admin.py | py | 786 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 13,
"usage_type": "attribute"
... |
21160846100 | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 30 19:00:57 2018
@author: HP
"""
from numpy import asarray
from numpy import zeros
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential, Model
from keras.la... | mharish2797/DNN-Text-Classifiers | Simple DNN classifiers/Brown Corpus based basic DNN Classifiers/Brown_classifier with parallel network.py | Brown_classifier with parallel network.py | py | 4,703 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "nltk.corpus.brown.categories",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.brown",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "nltk.corpus.brown.fileids",
"line_number": 46,
"usage_type": "call"
},
{
"api_name... |
19121772365 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.decorators import api_view, action
from rest_framework import viewsets, permissions, status
from django.http import Http404
from django.shortcuts import render
from leaderboard.m... | alex-gmoca/spring | spring/leaderboard/views.py | views.py | py | 2,128 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.shortcuts.render",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.reverse.reverse",
"line_number": 17,
"usage_type": "call"
},
... |
14876640371 | from django.db import models
from django.utils.text import slugify
class Pet(models.Model):
MAX_LENGTH_NAME = 30
name = models.CharField(
max_length=MAX_LENGTH_NAME,
null=False,
blank=False,
)
personal_pet_photo = models.URLField(
null=False,
blank=False,
... | Ivo2291/petstagram | petstagram/pets/models.py | models.py | py | 820 | python | en | code | 0 | github-code | 6 | [
{
"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.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
3013315354 | import time
import platform
import cpuinfo
os_version = platform.system()
print('CPU: ' + cpuinfo.get_cpu_info().get('brand_raw', "Unknown"))
print('Arch: ' + cpuinfo.get_cpu_info().get('arch_string_raw', "Unknown"))
print(f'OS: {str(os_version)}')
print('\nBenchmarking: \n')
start_benchmark = 10000 # change this ... | LopeKinz/raspberry_debug | test.py | test.py | py | 1,056 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "platform.system",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cpuinfo.get_cpu_info",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "cpuinfo.get_cpu_info",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "time.time",
... |
21990463619 | from flask import Flask, g, render_template,request,redirect,session,url_for,flash
import sqlite3
app = Flask(__name__)
app.config['SECRET_KEY'] = 'dev'
db_path = input("Enter database path: ")
# =============================================================================
# /Users/Eugen/Desktop/Final/blog.d... | EugenMorarescu/IS211_Final | Final/final_project.py | final_project.py | py | 5,821 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlite3.Row",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_numbe... |
12689186127 | import matplotlib.pyplot as plt
import requests
import numpy as np
# Enter Spotify web API access token credentials below
# If you don't have them you can get them here:
# https://developer.spotify.com/dashboard/applications
client_id = "YOUR_CLIENT_ID_HERE"
client_secret = "YOUR_SECRET_ID_HERE"
# The below code gen... | Oliver343/ArtistSearchAPI | ArtistSearch.py | ArtistSearch.py | py | 3,149 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.post",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "matplotlib.pypl... |
72453729787 | from django.conf.urls.defaults import *
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^lsdesign/', include('lsdesign.foo.urls')),
url(r'^$',
'django.views.generic... | cyndi/lacey-springs-designs | lsdesign/urls.py | urls.py | py | 955 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.contrib.admin.autodiscover",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
25958786704 | from django.db import models
from django.forms import ModelForm
from django.utils import timezone
class Author(models.Model):
NATION_CHOICES = (
(None, 'Nationality'),
('CH', 'China'),
('US', 'America'),
('UK', 'England'),
('GE', 'German'),
('CA', 'Canada'),
)
... | binkesi/blogsgn | models.py | models.py | py | 2,015 | python | en | code | 0 | github-code | 6 | [
{
"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.db.models.CharField",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": ... |
42749263557 | #!/usr/bin/env python
# coding=utf-8
# wujian@2018
import os
import argparse
import numpy as np
from libs.utils import istft, get_logger
from libs.opts import StftParser
from libs.data_handler import SpectrogramReader, WaveWriter
from libs.beamformer import DSBeamformer
logger = get_logger(__name__)
def run(args)... | Fuann/TENET | sptk/apply_ds_beamformer.py | apply_ds_beamformer.py | py | 2,731 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "libs.utils.get_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "libs.data_handler.SpectrogramReader",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "libs.beamformer.DSBeamformer",
"line_number": 35,
"usage_type": "call"
},
{... |
40407441083 | import sqlite3 as sql
def CreateDatabase():
coneccion = sql.connect("./Database/datos.db")
coneccion.commit()
coneccion.close()
CreateInitialTables()
print("Se ha creado la base de datos")
def SendQuery(query):
query = query
coneccion = sql.connect("./Database/datos.db")
cursor = conec... | Panconquesocl/LAS | Backend/DbUtils.py | DbUtils.py | py | 1,566 | python | es | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "random.choice",
"li... |
27391464453 | import logging
import os
from urllib.parse import urljoin, urlunparse
from rdflib import Graph, Literal, Namespace
from rdflib.namespace import OWL, RDF, RDFS, XSD
from crunch_uml import const, db, util
from crunch_uml.excpetions import CrunchException
from crunch_uml.renderers.renderer import ModelRenderer, Renderer... | brienen/crunch_uml | crunch_uml/renderers/lodrenderer.py | lodrenderer.py | py | 6,268 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "crunch_uml.renderers.renderer.ModelRenderer",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "crunch_uml.db.Database",
"line_number": 24,
"usage_type": "attribute"
},
... |
37710422808 | from azure.cognitiveservices.vision.customvision.training import training_api
from azure.cognitiveservices.vision.customvision.training.models import ImageUrlCreateEntry
from azure.cognitiveservices.vision.customvision.prediction import prediction_endpoint
from azure.cognitiveservices.vision.customvision.prediction.p... | Guptacos/tartanhacks2018 | image_recognition.py | image_recognition.py | py | 1,718 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "azure.cognitiveservices.vision.customvision.prediction.prediction_endpoint.PredictionEndpoint",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "azure.cognitiveservices.vision.customvision.prediction.prediction_endpoint",
"line_number": 16,
"usage_type": "name"
... |
15687075462 | """Module that contains reusable functions to interact with azure."""
import os
import yaml
import json
import shutil
from typing import Tuple, List, Dict, Union, Optional
from azureml.core import Workspace, Model, Dataset, Datastore
from azureml.core.compute import ComputeTarget, AmlCompute
from azureml.core.compute_... | ReBatch-ML/AnswerSearch | packages/azureml_functions.py | azureml_functions.py | py | 9,949 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.exists",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"lin... |
33504817634 | from .models.user_tokens import UserTokens
from .models.sources_enabled import SourcesEnabled
from .searchers.constants import DEFAULT_PAGE_SIZE
from .models.results import Results, SourceResult
from .searchers import available_searchers
from .decorators import immutable
import logging
from collections import defaultdi... | h4ck3rk3y/link | link/core.py | core.py | py | 4,506 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "models.user_tokens.UserTokens",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "models.sources_enabled.SourcesEnabled",
"line_number": 18,
"usage_type": "name"
},
{
... |
70680774589 | from django import forms
from crispy_forms.helper import FormHelper
from .models import Category
from crispy_forms.layout import Submit, Layout, Div, HTML, Field
class CategoryForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(CategoryForm, self).__init__(*args, **kwargs)
self.helpe... | ifcassianasl/movie-list | category/forms.py | forms.py | py | 965 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "crispy_forms.helper.FormHelper",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": ... |
40920706579 | from django.urls import path
from lanarce_portfolio.images.api.views import ImagesCreateListAPI, ImageUpdateDeleteAPI, CommentListAPI
app_name = "images"
urlpatterns = [
path(
"", ImagesCreateListAPI.as_view(), name="images-create-list"
),
path(
"<uuid:image_id>/", ImageUpdateDeleteAPI.as... | Ari100telll/lanarce_portfolio | lanarce_portfolio/images/urls.py | urls.py | py | 465 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "lanarce_portfolio.images.api.views.ImagesCreateListAPI.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "lanarce_portfolio.images.api.views.ImagesCreateListAPI",
"line_... |
72592445948 | import yaml
from .defaults import METADETECT_CONFIG
def load_config(config_path):
"""Load a config file and return it.
Parameters
----------
config_path : str, optional
The path to the config file.
Returns
-------
sim_config : dict
A dictionary of the sim config options.... | beckermr/metadetect-coadding-sims | coadd_mdetsims/config.py | config.py | py | 1,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.load",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "yaml.Loader",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "defaults.METADETECT_CONFIG",
"line_number": 41,
"usage_type": "argument"
}
] |
21011206894 | import argparse
import pandas as pd
import cv2
import mediapipe as mp
mp_pose = mp.solutions.pose
from pose_embedder import FullBodyPoseEmbedder
from pose_classifier import PoseClassifier
import numpy as np
classifiers = {}
def run_classify(csv_path):
# initialise Pose estimator for whole video
pose = mp_pose.Pos... | insidedctm/pose_knn_classifier | classify.py | classify.py | py | 2,471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "mediapipe.solutions",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pose_embedder.FullBodyPoseEmbedder",
"line_number": 34,
"usage_type": "call"
},
{
"api_na... |
40319564097 | from ansible.module_utils.basic import AnsibleModule
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler import \
module_dependency_error, MODULE_EXCEPTIONS
try:
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.helper.main import \
diff_remove_empty
from... | ansibleguy/collection_opnsense | plugins/modules/_tmpl_direct.py | _tmpl_direct.py | py | 3,679 | python | en | code | 158 | github-code | 6 | [
{
"api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.MODULE_EXCEPTIONS",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.handler.module_dependency_error",
"line_number": 14,
"u... |
3774639154 | __author__ = 'shixk'
import datetime
from SearchFiles import SearchFiles
class GetData(object):
def loadfilterdata(self, query, conf):
if query['method'] == "time":
return self.filterbydate(query, conf)
else:
return {'ERROR': 'no method'}
def filterbydate(self, query, ... | shinSG/SimplePictureService | HttpService/GetData.py | GetData.py | py | 1,285 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "SearchFiles.SearchFiles",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_nam... |
5001311387 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from .models import Question
class AnswerFrom(forms.Form):
content=forms.CharField(widget=forms.Textarea(attrs={'rows': 6}), label='Trả lời')
... | duonghau/hoidap | question/forms.py | forms.py | py | 1,575 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.forms.Form",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.forms"... |
21002262598 | import os
import pandas as pd
from natsort import natsorted
from openpyxl import load_workbook
dirName = './pozyxAPI_dane_pomiarowe'
def parse_learn_data():
data = pd.DataFrame()
for filename in natsorted(os.listdir(dirName)):
if filename.endswith(".xlsx"):
df = pd.read_excel(f"{dirName}/... | precel120/SISE | Task 2/excel.py | excel.py | py | 1,618 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "natsort.natsorted",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.