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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22658947772 | import re
import json
data = {
"msg": "sucess!",
"code": 0,
"data": [{
"id": 15,
"name": "test",
"sex": "",
"age": 21,
"mail": "283340479@qq.com",
"create_time": "2020-12-17"
}
]
}
result = json.dumps(data) #json字符串
# print(... | ltpts/MyStudy | lesson4/f.py | f.py | py | 442 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.dumps",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 22,
"usage_type": "call"
}
] |
24558913747 | import tempfile
from copy import deepcopy
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.callbacks import BaseCallbackHandler
from langchain_core.outputs import Generation, LLMResult
import langch... | langchain-ai/langchain | libs/community/langchain_community/callbacks/comet_ml_callback.py | comet_ml_callback.py | py | 23,193 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "typing.Any",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "comet_ml.Experiment",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "typing.Any",
"line... |
20386338984 |
import queue
import threading
from urllib import request
from bs4 import BeautifulSoup
from url import URL
import logging
logging.basicConfig(level=logging.INFO)
def urlfilter(current_url, target_url):
"""only for dult news webpage"""
if not target_url:
return None
if target_url.startswith('http... | lanqing30/TinySearchEngine | Spider/spider.py | spider.py | py | 3,711 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.basicConfig",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "queue.Queue",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "urllib.request.Reques... |
13020868759 | import matplotlib.pyplot as plt
import numpy as npy
def waveFunction(x):
return x * npy.sin(1/x)
x = npy.arange(-1.0, 1.0, 0.002)
vfunc = npy.vectorize(waveFunction)
vfunc(x)
plt.plot(x, vfunc(x), linewidth=1.0)
plt.title('y = x * sin(1/x)')
plt.xlabel('x')
plt.ylabel('y')
plt.grid(True)
p... | StaticNoiseLog/python | ffhs/semesterarbeit/2/plot_single.py | plot_single.py | py | 331 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sin",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.vectorize",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"li... |
14314323036 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.optimize import minimize
def rodrigues(v, k, alpha):
'''
Return the rotated vector v about vector k by an angle alpha, using the Rodrigues formula
'''
k = k / np.linalg.norm(k)
return v * np.cos(alph... | asierro/TFM_repo | sisl_plotly/dnbp_dipole/dnbp_dipole.py | dnbp_dipole.py | py | 6,556 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "numpy.cos",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.cross",
"line... |
13414924319 | import torch
from torch import nn
import torch.nn.functional as F
import fps_cuda
import sys
sys.path.append('/mnt/Disk16T/chenhr/threed/utils')
from utils_func import ball_query_cuda2, knn_query_cuda2, index_points, index_gts, PEGenerator
from memory import Memory
class PointSetAbstractionLayer(nn.Module):
def _... | HaoRan-hash/threed | pointnet++/scannet/model_memory.py | model_memory.py | py | 8,140 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line... |
72685183904 | from typing import List
class Solution:
def maxProfit(self, prices: List[int]) -> int:
cur_min = float('inf')
answer = 0
for price in prices:
if price < cur_min:
cur_min = price
answer = max(price - cur_min, answer)
return answer
| daviddwlee84/LeetCode | Python3/Array/BestTimetoBuyandSellStock/Naive121.py | Naive121.py | py | 311 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
4668448411 | from django.contrib import admin
from .models import Game
@admin.register(Game)
class GameAdmin(admin.ModelAdmin):
list_display = ("pk", "email", "number_of_games")
search_fields = ("email",)
list_filter = ("number_of_games",)
empty_value_display = "-пусто-"
| Stevinel/django-game-project | api/admin.py | admin.py | py | 283 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.register",
"line_number": 6,
"usage_type": "call"
},
{
... |
39766616146 | from rest_framework import pagination
from rest_framework.response import Response
class LinkHeaderPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data, **kwargs):
next_url = self.get_next_link()
previous_url = self.get_previous_link()
if next_url is not None and previous_u... | chriscauley/lablackey | lablackey/api/pagination.py | pagination.py | py | 955 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.pagination.PageNumberPagination",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.pagination",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "rest_framework.response.Response",
"line_number": 23,
"usage_... |
43723598015 | """
Unofficial Python API Wrapper for BandsInTown API
https://github.com/papernotes
"""
import requests
class Client(object):
"""
Class object to use BandsInTown API
"""
def __init__(self, app_id):
self.app_id = app_id
self.artist_url = "http://api.bandsintown.com/artists/... | jcwall/py-bandsintown | bandsintown/bandsintown.py | bandsintown.py | py | 9,045 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_numbe... |
9597009918 | import json
import re
import sys
import argparse
import time
from urllib import parse
from bs4 import BeautifulSoup
import numpy as np
import random
import asyncio
from pyppeteer import launch, launcher
from fake_useragent import UserAgent
launcher.DEFAULT_ARGS.remove("--enable-automation")
def ease_out_quad(x):
... | qingfusheng/meituanwaimai_Crawler | pyppeteer/main.py | main.py | py | 8,625 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "pyppeteer.launcher.DEFAULT_ARGS.remove",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyppeteer.launcher.DEFAULT_ARGS",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pyppeteer.launcher",
"line_number": 14,
"usage_type": "name"
... |
17910390444 | from tqsdk.objs import Order
from dao.odm.future_trade import (
BottomOpenVolume, BottomOpenVolumeTip,
BottomTradeStatus, MainOpenVolume,
MainTradeStatus, MainJointSymbolStatus, TradeStatus
)
import dao.trade.trade_dao as dao
import dao.trade.main_trade_dao as mdao
import dao.trade.bottom_trade_dao as bdao
... | galahade/future_trading | dao/trade/trade_service.py | trade_service.py | py | 4,453 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.common_tools.get_custom_symbol",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dao.trade.trade_dao.getMainJointSymbolStatus",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "dao.trade.trade_dao",
"line_number": 21,
"usage_type": ... |
13451723516 | #!/usr/bin/env python
from setuptools import setup
from xdsmjs import __version__
version = __version__
PKG_VERSION_NUMBER = None
if PKG_VERSION_NUMBER:
version += ".{}".format(PKG_VERSION_NUMBER)
CLASSIFIERS = """
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audienc... | whatsopt/XDSMjs | py_xdsmjs/setup.py | setup.py | py | 1,125 | python | en | code | 12 | github-code | 7 | [
{
"api_name": "xdsmjs.__version__",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "setuptools.setup",
"line_number": 24,
"usage_type": "call"
}
] |
31725633120 | from multiprocessing import Pool
import os,time,random
def run(name):
print("子进程%d启动--%s"%(name,os.getpid()))
start = time.time()
time.sleep(random.choice([1,2,3]))
end = time.time()
print("子进程%d结束--%s--耗时%.2f"%(name,os.getpid(),end-start))
if __name__ == "__main__":
print("父进程开始")
#创建多个进程... | kmxz2016/PycharmProjects | 进程/启动大量子进程.py | 启动大量子进程.py | py | 841 | python | zh | code | 1 | github-code | 7 | [
{
"api_name": "os.getpid",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 7,
... |
4611232195 | import config
def encrypt(text, key=config.KEY, abc=config.BASIC_ABC):
cipher = ''
for x in text:
elem_isupper = True if x.isupper() else False
elem = x.upper()
if elem in abc:
index = abc.index(elem)
if index + key >= len(abc):
if elem_isupper:
... | StruiAntonBy/Additional-computer-science-chapters | лаб 11 Шифрования дешифрования методом Цезаря/main.py | main.py | py | 1,752 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "config.KEY",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "config.BASIC_ABC",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "config.KEY",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "config.BASIC_ABC"... |
44383904309 | import argparse
import os
import pprint
import shutil
import _init_paths
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from lib.core.config import config
from lib.core.config import update_config
from lib.core.... | mkocabas/EpipolarPose | scripts/train.py | train.py | py | 5,905 | python | en | code | 577 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "lib.core.config.update_config",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "lib.core.config.config.PRINT_FREQ",
"line_number": 44,
"usage_type": "attribute"
... |
18230529885 | import pathlib
import random
import requests
import wikipedia
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from urllib.parse import quote
from typing import List
IMAGES_DIR = "images"
class FirstScreen(Screen):
def get_wikipedia_image_url(sel... | ZombieSocrates/python-adv-oop | webcam-sharer/kivy_demo_app.py | kivy_demo_app.py | py | 3,034 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "kivy.uix.screenmanager.Screen",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "wikipedia.page",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "random.choic... |
72844282462 | import os
import argparse
import stat
import pickle as p
import cv2
import numpy as np
from PIL import Image
from tqdm import tqdm
model_config = {
'resize': 32,
'mean': [0.5070751592371323, 0.48654887331495095, 0.4409178433670343],
'std': [0.2673342858792401, 0.2564384629170883, 0.27615047132568404],
}
... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/built-in/cv/resnet50_mmlab_for_pytorch_for_POC/create_quant_data.py | create_quant_data.py | py | 3,593 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "PIL.Image.BILINEAR",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pickle.load",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line... |
24355877831 | import uuid
from typing import Any, Dict, List, Optional, Union
from ..utils import add_end_docstrings, is_tf_available, is_torch_available, logging
from .base import PIPELINE_INIT_ARGS, Pipeline
if is_tf_available():
import tensorflow as tf
if is_torch_available():
import torch
logger = logging.get_logge... | FMInference/FlexGen | benchmark/third_party/transformers/src/transformers/pipelines/conversational.py | conversational.py | py | 13,466 | python | en | code | 8,687 | github-code | 7 | [
{
"api_name": "utils.is_tf_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "utils.is_torch_available",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.logging.get_logger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
70996462623 | from tqdm import tqdm
import time
from multiprocessing import Pool
import json
# dataset.append({
# 'paper_id': metadata['paper_id'],
# 'section_index': index,
# 'file_index': f"{ab}",
# 'file_offset': metadata['file_line_o... | Data-Science-2Like/dataset-creation | auxilary/check_consistency.py | check_consistency.py | py | 3,437 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tqdm.tqdm",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 77,
"usage_type": "call"
}
] |
5466162527 | from vision.ssd.mobilenet_v2_ssd_lite import create_mobilenetv2_ssd_lite, create_mobilenetv2_ssd_lite_predictor
from vision.utils.misc import Timer
import cv2
import sys
import numpy as np
if len(sys.argv) < 4:
print('Usage: python run_ssd_live_demo.py <net type> <model path> <label path> [video file]')
sys.e... | Shengjie-bob/Face_Mask_Detection | code/MobileNetV2-SSD-lite/run_ssd_live_demo.py | run_ssd_live_demo.py | py | 2,408 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 11,
... |
72185421662 | #encoding=utf-8
from selenium import webdriver
import time
import re
import io
import sys
def crawl_frame(frame_xpath, f):
driver.switch_to.default_content()
# 팝니다 iframe 가져오기
frame = driver.find_element_by_xpath(frame_xpath)
# 팝니다 iframe으로 스위치
driver.switch_to.frame(frame)
for pg in [1, 3, 4, 5, -1]:
for i in... | gasbank/forty | crawl.py | crawl.py | py | 2,646 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.split",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.exc_info",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "io.open",
"line_number": 57,
... |
10940487380 | import sys
from PyQt6.QtCore import QSize, Qt, QRegularExpression
from PyQt6.QtGui import QRegularExpressionValidator
from PyQt6.QtWidgets import QMainWindow, QApplication, QPushButton, QHBoxLayout, \
QWidget, QVBoxLayout, QLabel, QLineEdit, QListWidget
# VENTANA:
class VentanaPrincipal(QMainWindow):
def... | muertexer/Tpa-2023-AntBri | Taller de programacion aplicada/Actividades y Tareas/Tarea 3/Ej 9.py | Ej 9.py | py | 1,641 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "PyQt6.QtWidgets.QMainWindow",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "PyQt6.QtCore.QSize",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "PyQt6.QtWidgets.QVBoxLayout",
"line_number": 13,
"usage_type": "call"
},
{
"api_nam... |
71495639903 | from Layers.layers import Transformer
from Utils.utils import positional_encoding
import torch
import torchvision.models as models
from torch import nn
class detection_transformer(nn.Module):
"""
DETR (Detection Transformer) Model.
Args:
size (int): Size.
batch_size (int): Batch size.
... | TapasKumarDutta1/Transformer-pytorch | detection/DETR.py | DETR.py | py | 3,899 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torchvision.models.resnet50",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torchvision.m... |
33413987411 | #coding=utf-8
import socket
from multiprocessing import Process
import re
htmlRootDir = "/Users/huxiaoyi/Desktop/"
class HTTPServers(object):
def __init__(self,port):
self.serverSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
self.serverSocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEAD... | microease/Heima-Python-2018 | 00-2017/就业班/01练习/静态web服务器.py | 静态web服务器.py | py | 1,980 | python | en | code | 25 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "socket.SOL_SOC... |
36613107715 | '''
Created on Jan 9, 2018
@author: mehmetcan
'''
import Cryptopia
import Hitbtc
import Bittrex
import Poloniex
import Kucoin
import Bitz
import json
import requests
import Data
def getFromBittrex():
response = requests.get(Bittrex.tickerUrl)
js = json.loads(response.content)
for i in js['result']:
... | mehmetcanyegen/flipcoin | flipcoin.py | flipcoin.py | py | 2,438 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "Bittrex.tickerUrl",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Data.reloadCoinValue",... |
74662417823 | import os
import requests
import tarfile
#from clint.textui import colored
from tqdm import tqdm
from pathlib import Path
from tabulate import tabulate
pwd=os.getcwd()
zimbra = os.path.join(pwd, "zimbra.tgz")
src = os.path.join(pwd, "src")
compressed_zimbra = Path(zimbra)
ext_src = Path(src)
url = 'https://files.zim... | faizal2007/zimbra-tools | install.py | install.py | py | 2,068 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.getcwd",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": ... |
21156558706 | import requests
from pathlib import Path
from dotenv import load_dotenv
import os
load_dotenv(Path(__file__).parent.parent.joinpath(".env"))
API_KEY =os.environ["DEEPL_API_KEY"]# 自身の API キーを指定
# 英語の文字列のリストを受け取り、翻訳した文章を追加したリストとして返す
def translate_ja_list(content_list):
# content_list = [article['Content_En'] for a... | arietis-blue/arxivkids | server/App_Folder/api_call/deepl_api/deepl.py | deepl.py | py | 2,477 | python | ja | code | 0 | github-code | 7 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "requests.post",
"lin... |
74191645984 | import torch
import torch.nn as nn
import wandb
import time
import numpy as np
import matplotlib.pyplot as plt
from einops import rearrange, repeat
import sys
from torch import optim
from tqdm import tqdm
# from dataset2 import dataset
# from loaderdep2 import dataset
from loaderdep import get_data_loaders
import cv2
#... | SHTCyuyh/Nlos_Learnable_Inverse_Kernel | trainer_dataprovider_chen.py | trainer_dataprovider_chen.py | py | 15,631 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.manual_seed",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "method.tfphasor... |
20390877012 | # encoding:utf-8
from __future__ import print_function
# Sequential组建序列模型,Model用来组合多个model
from keras.models import Sequential, Model
from keras.layers import Input, Dense, Reshape, Flatten, Embedding, Dropout
from keras.layers import UpSampling2D, Conv2D
from keras import layers
from keras.layers.advanced_activations... | pythonProjectLearn/KearsLearning | 05_GAN/ACGAN/ACGAN_3D.py | ACGAN_3D.py | py | 12,262 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "keras.models.Sequential",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "keras.lay... |
36787182904 | import cv2
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
class ImageHelper:
def __init__(self, path):
self.input_image = Image.open(path)
self.width, self.height = self.input_image.size
self.pixels_number = self.width * self.height
self.input_image_cv2 =... | timurbl78/AI_assignment | assignment2/ImageHelper.py | ImageHelper.py | py | 2,484 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PIL.Image.open",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "PIL.Image.new",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 1... |
32942914662 | from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
import pandas as pd
import shap
class ExplanationShiftDetector(BaseEstimator, ClassifierMi... | nobias-project/nobias | nobias/distributionShift.py | distributionShift.py | py | 10,123 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.base.ClassifierMixin",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "sklearn.utils.validation.check_X_y",
"line_number": 110,
"usage_type": "call"
},
... |
32416546224 | import tornado.ioloop
from tornado.web import RequestHandler, Application, url
class MainHandler(RequestHandler):
def get(self):
for i in range(1, 4):
self.write('<a href="{}">link to story {}</a><br>'.format(
self.reverse_url("story", str(i)), i))
class StoryHandler(Requ... | marltake/practice_py | tornado/story_links.py | story_links.py | py | 1,402 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tornado.web.RequestHandler",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "tornado.web.RequestHandler",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "tornado.web.Application",
"line_number": 21,
"usage_type": "call"
},
{
"api_... |
36574231746 | import pandas as pd
import numpy as np
import requests as req
import json
from datetime import datetime
from sklearn import cluster as cl
from flask import abort
from google.cloud import storage
API_KEY = 'ESTA NO SE COMPARTE'
def getDailyBars(ticker, start, end):
base_url = "https://api.polygon.io/v2/aggs/ticker... | Ch3ma/up_bd_202106 | GetHRP/main.py | main.py | py | 7,316 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"l... |
72081112862 | import json
import requests
from data_collection.general.static import end_date, endpoints, start_date
from data_collection.general.user import username, user_token
def update_commit_stats(pr_contribution_nodes, commit_stats):
for pr_node in pr_contribution_nodes:
pr = pr_node["pullRequest"]
... | chrisnguyn/fellowship-class-profile | data_collection/commit_stats.py | commit_stats.py | py | 3,655 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "data_collection.general.static.start_date",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "data_collection.general.static.end_date",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "requests.post",
"line_number": 60,
"usage_type": "call"... |
22585564720 | from aiogram.types import ReplyKeyboardRemove, \
ReplyKeyboardMarkup, KeyboardButton, \
InlineKeyboardMarkup, InlineKeyboardButton
from parserVK import WallParse
from db import Postgers
parser = WallParse()
db = Postgers()
def write_kb(user_id):
domains = db.get_domains(user_id)
domains_k... | YarMolenko13/NotifFromVkBot | keyboards.py | keyboards.py | py | 611 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "parserVK.WallParse",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "db.Postgers",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "db.get_domains",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aiogram.types.ReplyKeybo... |
36182320264 | from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.core.window import Window
from kivy.config import Config
Config.set('graphics', 'resizable', False)
import random
from datetime import datetime
#import time
import os
class Wyglad(FloatLayout):
# setting position of the window to... | sand194/diceapp_gui_kivy | gridlayout.py | gridlayout.py | py | 3,105 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "kivy.config.Config.set",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "kivy.config.Config",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "kivy.uix.floatlayout.FloatLayout",
"line_number": 17,
"usage_type": "name"
},
{
"api_name... |
31394730894 | from typing import Any, BinaryIO, Optional
from .model import BaiDuResponse
from .network import HandOver
class BaiDu(HandOver):
def __init__(self, **request_kwargs: Any):
super().__init__(**request_kwargs)
async def search(
self, url: Optional[str] = None, file: Optional[BinaryIO] = None
... | samttoo22-MewCat/Neko-discord-bot | PicImageSearch/baidu.py | baidu.py | py | 778 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "network.HandOver",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "typing.BinaryIO",
"line... |
14154429381 | import pygame
from tic_tac_toe.game_manager import GameManager
from tic_tac_toe.constans import SCREEN_SIZE, BACKGROUND_COLOR
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
clock = pygame.time.Clock()
game_manager = GameManager(main_screen=screen)
game_manager.init_game()
while True:
for event in ... | MarekBleschke/pygame-demos | tic_tac_toe/main.py | main.py | py | 687 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tic_tac_toe.constans.SCREEN_SIZE",
"line_number": 8,
"usage_type": "argument"
},
{
"api_name": ... |
7335166458 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "11/30/2017 10:32 AM"
import asyncio
from config import CONFIG
from .config import FILTERS_... | VirtualVFix/AndroidTestFramework | src/libs/core/unittest/wait.py | wait.py | py | 2,519 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "config.CONFIG.UNITTEST",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "config.CONFIG",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "asyncio.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "config.CONFIG... |
44355896114 | import torch
import torch.nn as nn
import torch.nn.functional as F
from bunch import Bunch
class SimpleAutoencoder(nn.Module):
def __init__(self, config: Bunch) -> None:
'''
Initialize the model
Args:
config: config file
'''
super(SimpleAutoencoder, self).__init... | vtsch/mt-vt | models/baseline_models.py | baseline_models.py | py | 4,539 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "bunch.Bunch",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_nu... |
18461522881 | import logging
from rest_framework import status
from rest_framework.views import APIView
from weibo_oauth import Weibo
from rest_framework.response import Response
from django.conf import settings
from rest_framework_jwt.settings import api_settings
from .models import OAuthWeiBoUser
from .serializers import WeiBoA... | daxiong001/meiduo | meiduo/apps/oauth/views.py | views.py | py | 3,146 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "rest_framework.views.APIView",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "weibo_oauth.Weibo",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "djan... |
9513835120 | from flask import Flask, render_template, request, jsonify
from decouple import config
import requests
import random
app = Flask(__name__)
# 토큰 변수 설정 후 api url 설정
token = config("TOKEN")
google_key=config("GOOGLE_API_KEY")
google_url = "https://translation.googleapis.com/language/translate/v2"
api_url = f"https://api... | YJEEEN/MachineLearning | chatBot/app.py | app.py | py | 2,306 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "decouple.config",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
... |
74135915744 | import pandas as pd
from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
data = pd.read_csv("studdent.csv")
feature = ["total","days"]
x = data[feature]
y = data["gender"]
model = DecisionTreeClassifier()
dtree = model.fit(x,y)
tree.plot_tree(dtree,feature_names=feature) | GokulRaj-S2401/Datasets | de_tree/main.py | main.py | py | 295 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.plot_tree",
"line_number": 14,
"usage_type": "call"
},
{
"api_nam... |
34114966436 | #!/usr/bin/env python3
import argparse
import urllib.parse
import os
import sys
import shutil
import subprocess
from ruamel import yaml
yaml.rload = lambda *z: yaml.load(*z, Loader=yaml.RoundTripLoader)
yaml.rdump = lambda *z: yaml.dump(*z, Dumper=yaml.RoundTripDumper)
def main():
template = yaml.rload(open('inst... | cburschka/cadence | scripts/configure.py | configure.py | py | 5,034 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "ruamel.yaml.rload",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "ruamel.yaml",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "ruamel.yaml.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "ruamel.yaml.Round... |
72844787742 | import os
import numpy as np
import argparse
import cv2
import warnings
import torch
import time
try:
from torch import npu_batch_nms as NMSOp
NMS_ON_NPU = True
except:
from torchvision.ops import batched_nms as NMSOp
NMS_ON_NPU = False
CLASSES = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', '... | Ascend/ModelZoo-PyTorch | ACL_PyTorch/contrib/cv/detection/SSD/ssd_postprocess.py | ssd_postprocess.py | py | 11,792 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "numpy.stack",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 110,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"li... |
2887574258 | import time, pytest, inspect
import utils
from utils import run_brave, create_config_file
from PIL import Image
'''
Does the mixer correctly position inputs, so that we can do picture-in-picture or a video-wall?
'''
def test_mixer_positioning(run_brave, create_config_file):
subtest_start_brave_with_multiple_posit... | bbc/brave | tests/test_mixer_positioning.py | test_mixer_positioning.py | py | 5,208 | python | en | code | 629 | github-code | 7 | [
{
"api_name": "utils.run_brave",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "utils.create_config_file",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "utils.create_config_file",
"line_number": 34,
"usage_type": "call"
},
{
"api_nam... |
15732644307 | import os
import sys
import time
from PIL import Image, ImageDraw, ImageFont
from cuars import faces
import adargb
io = adargb.BoardIO()
display = adargb.Display(135, 240)
table = faces.Table(240, 135, os.listdir(os.getcwd()))
font = ImageFont.truetype("fonts/BebasNeue.otf", 22)
image = Image.new("RGB", (240, 135))... | EricxDu/cuars | acp_test.py | acp_test.py | py | 1,396 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "adargb.BoardIO",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "adargb.Display",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cuars.faces.Table",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cuars.faces",
"li... |
30072461343 | import os
import sys
import datetime
import xarray as xr
import pismx.open
# processed runs
PROC_RUNS = ['alpcyc4.2km.grip.0820', 'alpcyc4.2km.grip.1040.pp',
'alpcyc4.2km.epica.0970', 'alpcyc4.2km.epica.1220.pp',
'alpcyc4.2km.md012444.0800', 'alpcyc4.2km.md012444.1060.pp',
'alpcy... | juseg/alps | data/postprocess_alpdeg_agg.py | postprocess_alpdeg_agg.py | py | 3,528 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.getlogin",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.uname",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.utcnow",
"li... |
41257053632 | import torch
import torch.nn.functional as F
from mmcv.cnn import ConvModule, Scale
from torch import nn
from torch.nn import init#
import functools#
from torch.autograd import Variable#
import numpy as np#
from mmseg.core import add_prefix
from ..builder import HEADS
from ..utils import SelfAttentionBloc... | Qiqi-0810/Drivable_area | mmsegmentation/mmseg/models/decode_heads/ReDA.py | ReDA.py | py | 12,301 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.SelfAttentionBlock",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "mmcv.cnn.Scale",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "torch.nn.Module",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "torch.nn... |
6024921253 | # -*- coding: utf-8 -*-
# This program is developed with python 3.x
# The following two types of input are avaliable:
# 1. Directory path of VPRN .txt files
# 2. the List of VPRN .txt files
#from PyQt5 import QtCore, QtGui, QtWidgets
import datetime
import re
import os
# workbook
from openpyxl.workbook imp... | DerekTan/CT_VPN_Extract | Do_VPRNDataExtract.py | Do_VPRNDataExtract.py | py | 11,052 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 28,
... |
8604206232 | import torch
from load import load_data
from dl import Bat_Net
from lr import LR
import numpy as np
def test():
train_features, train_labels, test_features, test_labels = load_data()
# 使用单一决策树建模
from sklearn.tree import DecisionTreeClassifier
tree = DecisionTreeClassifier(criterion='entropy', random_... | cnwxi/ML_BDA_LAB3 | main.py | main.py | py | 1,629 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "load.load_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.tree.DecisionTreeClassifier",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sklearn.metrics.accuracy_score",
"line_number": 18,
"usage_type": "call"
},
{
"... |
35333633281 | __license__ = "MIT"
__author__ = "Augusto Cunha, Axelle Pochet"
__email__ = "acunha@tecgraf.puc-rio.br, axelle@tecgraf.puc-rio.br"
__credits__ = ["Augusto Cunha", "Axelle Pochet", "Helio Lopes", "Marcelo Gattass"]
from tensorflow.keras import backend as K
# K.set_image_dim_ordering('tf')
# K.set_image_data_format('cha... | anyuzoey/CNNforFaultInterpretation | SFD-CNN-TL/classifier.py | classifier.py | py | 9,326 | python | en | code | 50 | github-code | 7 | [
{
"api_name": "tensorflow.ConfigProto",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend.set_session",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.backend",
"line_number": 13,
"usage_type": "name"
},
{
... |
11513785645 | import torch
import torch.nn as nn
import numpy as np
"""
This script implements a kernel logistic regression model, a radial basis function network model
and a two-layer feed forward network.
"""
class Kernel_Layer(nn.Module):
def __init__(self, sigma, hidden_dim=None):
"""
Set hyper-parameters... | AmitPatilTamu/Kernel-Methods-PCA-AE | kernel/code/network.py | network.py | py | 8,107 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Parameter",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line... |
42643374868 | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="CodatPublicApiModelsClientsBankingSettingsModelsBankIntegration")
@attr.s(auto_attribs=True)
class CodatPublicApiModelsClientsBankingSettingsModelsBankIntegration:
"""
Attributes:
... | levrofin/levro-codat | codat_api_client/models/codat_public_api_models_clients_banking_settings_models_bank_integration.py | codat_public_api_models_clients_banking_settings_models_bank_integration.py | py | 1,628 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.TypeVar",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.Unset",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "types.UNSET",
"line_number... |
20906200411 | """
The first frame should be of the static background i.e. without any objects.
"""
import cv2
import pandas
from datetime import datetime
first_frame = None
status_list = [None, None]
timestamp = []
df = pandas.DataFrame(columns=['Start', 'End'])
video = cv2.VideoCapture(0)
while True:
check, frame = video.r... | shan18/Computer-Vision-with-OpenCV | webcam_motion_detector/motion_detection.py | motion_detection.py | py | 2,405 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
... |
8313524838 | from swagger_server.models import AgeGroup, Image, LanguageSpec, Phone, UserId
from swagger_server.models.age_group import AgeGroupEnum
from swagger_server.models.language_spec import LanguageSpecEnum
from swagger_server.repository.user import User
import random
from typing import List, Optional, Tuple
u1 = User(id=1... | HippoChat/hippo_backend | swagger_server/service/heart.py | heart.py | py | 2,644 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "swagger_server.repository.user.User",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "swagger_server.models.age_group.AgeGroupEnum.G_18",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "swagger_server.models.age_group.AgeGroupEnum",
"line... |
42286177748 |
'''borf.borf: for running borf'''
import argparse
import os
import sys
import re
from Bio import SeqIO
import pandas as pd
from .get_orfs import get_orfs, write_orf_fasta, write_orf_data, write_orf_cds, batch_iterator
def main():
parser = argparse.ArgumentParser(description='Get orf predicitions from a nucleo... | signalbash/borf | borf/borf.py | borf.py | py | 8,052 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.path.isfile"... |
71163637025 | import os
import json
import requests
import copy
import datetime
class _SdcCommon(object):
'''Interact with the Sysdig Monitor/Secure API.
**Arguments**
- **token**: A Sysdig Monitor/Secure API token from the *Sysdig Cloud API* section of the Settings page for `monitor <https://app.sysdigcloud.com/#/... | draios/python-sdc-client-beta | sdcclient/_client.py | _client.py | py | 91,101 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
42156920501 | import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score, mean_squared_error
import seaborn as sns
from sqlalchemy import create_engine
def load_data(mess... | sunxingshu/Disaster-Response-Pipeline | data/process_data.py | process_data.py | py | 3,415 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.merge",
"line... |
21223232958 | import torch
import torch.nn as nn
eps=1e-8
def sinkhorn(M,r,c,iteration):
p = torch.softmax(M, dim=-1)
u = torch.ones_like(r)
v = torch.ones_like(c)
for _ in range(iteration):
u = r / ((p * v.unsqueeze(-2)).sum(-1) + eps)
v = c / ((p * u.unsqueeze(-1)).sum(-2) + eps)
p = p * u.uns... | vdvchen/SGMNet | sgmnet/match_model.py | match_model.py | py | 11,656 | python | en | code | 117 | github-code | 7 | [
{
"api_name": "torch.softmax",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "torch.ones_like",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.ones_like",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.cat",
"line_numb... |
42045538508 | from typing import TYPE_CHECKING
from magicgui import magic_factory
if TYPE_CHECKING:
import napari
def connect_events(widget):
"""
Connect widget events to make some visible/invisible depending on others
"""
def toggle_median_n_widget(event):
widget.median_n.visible = event
# Connect... | schutyb/napari-hsi-phasor | src/napari_hsi_phasor/_widget.py | _widget.py | py | 6,334 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "napari_hsi_phasor.hsitools.tilephasor",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "napari_hsi_phasor.hsitools.stitching",
"line_number": 73,
"usage_type": "call"
... |
7187864743 | import csv
import datetime
import re
from django.core.management.base import BaseCommand
from phones.models import Phone
def str_to_date(str_date):
pattern = re.compile(r'\d+')
result = pattern.findall(str_date)
correct_date = datetime.date(int(result[0]), int(result[1]), int(result[2]))
return correc... | Kwartoshka/DJHW | databases/work_with_database/phones/management/commands/import_phones.py | import_phones.py | py | 822 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.core.management.base.BaseCommand",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "phone... |
19440037424 | import time
from BTrees.OOBTree import OOBTree
from clouddrive import db
from clouddrive import configurator
import requests
import transaction
from urllib.parse import urlencode
LOGIN_URL = 'https://www.amazon.com/ap/oa'
AUTH_URL = 'https://api.amazon.com/auth/o2/token'
SCOPES = [
'clouddrive:read_all',
'c... | vangheem/clouddrive | clouddrive/api.py | api.py | py | 3,534 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "clouddrive.configurator.CLIENT_ID",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "clouddrive.configurator",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "urllib.parse.urlencode",
"line_number": 30,
"usage_type": "call"
},
{
... |
35168020795 | # %%
from statistics import mean
input = open('input.txt')
lines = input.read().splitlines()
input.close()
# %%
binaries = [list(map(int, list(line))) for line in lines]
transposed = list(map(list, zip(*binaries)))
means = [mean(line) for line in transposed]
gamma_binary = [round(x) for x in means]
epsilon_binary = [1-... | LarsZondag/AdventOfCode | 2021/day03/1.py | 1.py | py | 598 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "statistics.mean",
"line_number": 9,
"usage_type": "call"
}
] |
18178131383 | import math
import torch
import torch.nn as nn
from fairseq.data.data_utils import collate_tokens
from transformers import BartTokenizer
class ConditionalSequenceGenerator:
"""Conditional sequence generator for calculating prior and posterior probability."""
def __init__(self, bart):
self.bart = bart... | mcao516/EntFA | src/EntFA/model.py | model.py | py | 9,814 | python | en | code | 19 | github-code | 7 | [
{
"api_name": "transformers.BartTokenizer.from_pretrained",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "transformers.BartTokenizer",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "fairseq.data.data_utils.collate_tokens",
"line_number": 62,
"usage_... |
14812882254 | __author__ = " Parya Derakhshan "
import numpy as np
from collections import OrderedDict
from inout import Error,Log
EPSILON = '~'
START,END='START','EOF'
ACCEPT,ERROR,POP='ACCEPT','ERROR','POP'
errors = {
'll1':'GrammarError',
'prsr':'ParserError [LR1]'
}
class Item(): # variable --> [completed] . [expected... | p-derakhshan/SimpleCompiler | parser_lr1.py | parser_lr1.py | py | 17,191 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "inout.Error",
"line_number": 101,
"usage_type": "call"
},
{
"api_name": "collections.OrderedDict",
"line_number": 102,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 152,
"usage_type": "call"
},
{
"api_name": "inout.Error",
"... |
37078265118 | import os
import scipy.misc
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from model import DCGAN
from utils import pp, visualize, to_json, show_all_variables, inverse_transform
from time import gmtime, strftime
flags = tf.app.flags
flags.DEFINE_integer("epoch", 50, "Epoch to train [25]"... | SergeKo/DCGAN-tensorflow | main.py | main.py | py | 6,835 | python | en | code | null | github-code | 7 | [
{
"api_name": "tensorflow.app",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "utils.pp",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
17180429210 | from typing import List
class Solution:
"""灵感来自花花的longest substring of XXX的模板
https://zxi.mytechroad.com/blog/hashtable/leetcode-1542-find-longest-awesome-substring/"""
def maxSubArrayLen(self, nums: List[int], k: int) -> int:
idx = dict()
idx[0] = -1
s = 0 # 初始状态, 表示前缀数组的和
... | miniyk2012/leetcode | leetcode_projects/leetcode_325/solution.py | solution.py | py | 794 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
}
] |
42652701098 | #!/usr/bin/env python3
def psfstudy(band_path, ztfname, filtercode, logger, args):
import pathlib
import gc
import traceback
import numpy as np
from numpy.polynomial.polynomial import Polynomial
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.cm import ScalarMappable
... | lacroixle/phdev | deppol/deppol_psfstudy.py | deppol_psfstudy.py | py | 11,288 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.use",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "deppol_utils.quadrants_from_band_path",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "utils.ListTable.from_filename",
"line_number": 33,
"usage_type": "call"
},
{
... |
30456297589 | import itertools
n=int(input())
my_dictionary = {"TOI": 26,"Hindu":20.5,"ET":34,"BM":10.5,"HT":18}
values = my_dictionary.values()
keys = my_dictionary.keys()
result = [seq for i in range(len(values), 0, -1)
for seq in itertools.combinations(keys, 2)
if sum(map(my_dictionary.get,seq))... | MOHIT-PANIGRAHI/testvagrent | text.py | text.py | py | 536 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "itertools.combinations",
"line_number": 7,
"usage_type": "call"
}
] |
6611465084 | #!/usr/bin/env python
# peak detection: https://qiita.com/wrblue_mica34/items/e174a71570abb710dcfb
import rospy
from std_msgs.msg import *
from geometry_msgs.msg import *
from scipy import signal
import numpy as np
sensitivity_ = 50
def callback(msg):
global sensitivity_
maxid_list = []
y = np.array(msg.dat... | hoshianaaa/data_analyse_ros | scripts/peak_detection.py | peak_detection.py | py | 1,434 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "scipy.signal.argrelmax",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "scipy.signal.argrelmi... |
7225153523 | # patricia.angie.kwarwp-mapa-indio.py
# SPDX-License-Identifier: GPL-3.0-or-later
""" Projeto Kwarwp
.. codeauthor:: Monica Novellino <monicanovellino@gmail.com>
Changelog
---------
.. versionadded:: 20.07
Montando o jogo usando mapa e o índio
"""
MAPA_INICIO = """
@....&
......
.....#
.#.^..
"""
MAP... | kwarwp/patricia | angie/kwarwp-mapa-indio.py | kwarwp-mapa-indio.py | py | 4,841 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "collections.namedtuple",
"line_number": 88,
"usage_type": "call"
},
{
"api_name": "_spy.vitollino.main.STYLE",
"line_number": 139,
"usage_type": "name"
},
{
"api_name": "_spy.vitollino.main.STYLE",
"line_number": 140,
"usage_type": "name"
},
{
"api_... |
7302830060 | import pandas as pd
from openpyxl import load_workbook
def write_to_excel(df, name):
book = load_workbook('stock.xlsx')
if name in book.sheetnames:
book.remove(book[name])
book.save('stock.xlsx')
book = load_workbook('stock.xlsx')
with pd.ExcelWriter('stock.xlsx') as writer:
writer.book = book
writer.sheet... | amarkamthe/SplitReport | stock.py | stock.py | py | 3,060 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "openpyxl.load_workbook",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.ExcelWriter",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas... |
4425882978 | import time
from http import HTTPStatus
import uweb3
import invoices.login.model as login_model
from invoices.invoice.model import PRO_FORMA_PREFIX
API_VERSION = "/api/v1"
class PageMaker(
uweb3.DebuggingPageMaker,
uweb3.LoginMixin,
):
"""Holds all the request handlers for the application"""
def _... | underdarknl/uweb3-invoice | invoices/basepages.py | basepages.py | py | 3,384 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "uweb3.DebuggingPageMaker",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "uweb3.LoginMixin",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "invoices.invoice.model.PRO_FORMA_PREFIX",
"line_number": 28,
"usage_type": "argument"... |
43191349385 | """Tests for cell_img.image_grid.ts_index_lib."""
import copy
from absl.testing import absltest
from cell_img.image_grid import ts_index_lib
import numpy as np
import pandas as pd
class Single1DTest(absltest.TestCase):
def test_get_index_individually(self):
lookup = ts_index_lib._Single1D(
['zero', '... | google/cell_img | cell_img/image_grid/ts_index_lib_test.py | ts_index_lib_test.py | py | 16,733 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "absl.testing.absltest.TestCase",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "absl.testing.absltest",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "cell_img.image_grid.ts_index_lib._Single1D",
"line_number": 14,
"usage_type": "... |
35481265859 | import logging
import time
from datetime import datetime, timedelta, timezone
from typing import Dict, List, Optional, Tuple, Union
from pydantic import BaseModel, PrivateAttr # pylint: disable=no-name-in-module
from sqlalchemy import Column, DateTime, String
from sqlalchemy.ext.declarative import declarative_base
fr... | AngellusMortis/sxm-player | sxm_player/models.py | models.py | py | 9,233 | python | en | code | 24 | github-code | 7 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String",
"line_number": 22,
"usage_type": "argument"
},
{
... |
26443167283 | from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
import pyqtgraph.opengl as gl
import numpy as np
from OpenGL.GL import glEnable, glDisable, GL_DEPTH_TEST
class CustomViewWidget(gl.GLViewWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.opts['distance'] = 10
self.opt... | quothbonney/gpgc-vis | test1000.py | test1000.py | py | 2,234 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pyqtgraph.opengl.GLViewWidget",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "pyqtgraph.opengl",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pyqtgra... |
70441471264 | import socket
import cv2
#from PIL import Image
#from PIL import ImageTk
import os, sys, Tkinter
import time
import cv2
server_socket=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind(('0.0.0.0', 9001))
server_socket.listen(1)
client_socket, address = server_socket.accept()
while True:... | daniel11300/project | Code/serverVideo_1.py | serverVideo_1.py | py | 584 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
... |
27846298043 | import torch
import numpy as np
from pytorch_fid import fid_score
import prdc
from .metrics_helpers import InceptionHelper
from .ood_helpers import ood_acc
def fid(module, eval_loader=None, train_loader=None, gen_samples=50000, gen_batch_size=64,
cache=None):
"""
Following Heusel et al. (2017), compu... | layer6ai-labs/two_step_zoo | two_step_zoo/evaluators/metrics.py | metrics.py | py | 3,255 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "metrics_helpers.InceptionHelper",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.cov",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.mean",
... |
38391727498 | from django.shortcuts import render, redirect
from .models import Task
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login
from .forms import UserRegistration
from django.contrib.auth.models import User
# Create your views here.
@login_required
def home(request):
tasks ... | vivekthedev/to-do-list-with-database | tasks/views.py | views.py | py | 1,830 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "models.Task.objects.all",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "models.Task.objects",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "models.Task",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "django.s... |
74645827102 | from flask import Flask
import utils
from flask import jsonify
from flask import render_template
app = Flask(__name__)
@app.route('/')
def hello_word():
return render_template('main.html')
@app.route("/l1")
def get_l1_data():
data = utils.L1_data()
day, confirm, cure, dead = [], [], [], []
for id_, ... | WxylkxyZz/Epidemic_desig | app.py | app.py | py | 1,375 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "utils.L1_data",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.jsonify",
"l... |
70914796385 | import os, sys, random
import numpy as np
from tqdm import tqdm
import torch
from torch.utils.data import DataLoader
from transformers import AutoConfig
from transformers import LongformerModel, LongformerTokenizer
import argparse
from utils import collate_fn_bert_single_row
from utils import get_single_row_scene_c... | YisiSang/TVSHOWGUESS | run_longformer.py | run_longformer.py | py | 13,332 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "random.seed",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"lin... |
38507133931 | import sys
import os
import warnings
from models.model_vgg import CSRNet as CSRNet_vgg
from models.model_student_vgg import CSRNet as CSRNet_student
from utils import save_checkpoint
from utils import cal_para, crop_img_patches
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision ... | zeeshaan28/Light-Weight-Crowd-Counter | video_test.py | video_test.py | py | 3,602 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "torch.cuda.manual_seed",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"li... |
2707917172 | import requests
from bs4 import BeautifulSoup
from telebot import TeleBot , types
import csv
import telegram_bot
bot = TeleBot('1452583001:AAG5Teqf1RLWjZNjTa5tRDn-aIUlyS9Tv6w')
main_keyboard = types.InlineKeyboardMarkup(row_width=2)
btn1 = types.InlineKeyboardButton("USD", callback_data="USD")
btn2 = types.Inline... | RowdyKGZ/exchange_bot | telegram.py | telegram.py | py | 2,431 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "telebot.TeleBot",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "telebot.types.InlineKeyboardMarkup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "telebot.types",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "teleb... |
5618935642 | from falcon_cors import CORS
import falcon
import json
import os
from src.cors.meal import get_content
class GetContent(object):
def on_get(self, req, resp, filename):
'''
'''
menu = get_content(filename)
result = {
'code': 200,
'content': ... | IAMZn1018/quick-order-web | run_server.py | run_server.py | py | 2,646 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "src.cors.meal.get_content",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "falcon.HTTP_200",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "json.dumps"... |
42639339716 | from tornado.web import Application, RequestHandler
from tornado.ioloop import IOLoop
import querybank
import os
import psycopg2
from datetime import datetime
import json
import copy
import logging
import traceback
import io
import csv
# Set logging threshold level
logger = logging.getLogger()
logger.setLevel(logging... | NUS-IDS/cofi | src/viz/backend/app.py | app.py | py | 13,662 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
22682254073 | import pytest
from ceramic.rules import Rules
@pytest.mark.parametrize("player_count", [2, 4])
@pytest.mark.parametrize("tile_count,tile_types,factory_tiles", [
(15, 3, 3),
(20, 5, 4),
])
@pytest.mark.parametrize("line_bonus,column_bonus,type_bonus", [
(3, 2, 5),
(7, 3, 15),
])
@pytest.mark.parametriz... | Swynfel/ceramic | tests/state/test_rules.py | test_rules.py | py | 1,418 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "ceramic.rules.Rules",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "ceramic.rules.Rules",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pytest... |
27264722877 | from django.http import HttpResponse
from calorietracker.models import Meal, Food, Weight
from django.core import serializers
from datetime import datetime, timedelta
import json
from django.template import RequestContext, loader
from django.shortcuts import render
from django.views.decorators.cache import cache_page
f... | PSpeiser/PythonLifeManager | calorietracker/views.py | views.py | py | 10,972 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.http.require_GET",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.render",
"line_number": 25,
"usage_type": "call"
},
... |
75023407903 | import torch
from torch import nn
import torch.nn.functional as F
import networks.settings_dcsfn as settings
from itertools import combinations,product
import math
class Inner_scale_connection_block(nn.Module):
def __init__(self):
super(Inner_scale_connection_block, self).__init__()
self.channel = ... | cuiyixin555/DeRain-DWT | networks/model_dcsfn.py | model_dcsfn.py | py | 11,398 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.nn.ModuleList",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
37415792813 | # from django.contrib.auth.models import User
from texts.models import Recipient, Product, ProductCampaign
from django.http import HttpResponse
from twilio.rest import Client
import os
from django.views.decorators.csrf import csrf_exempt
from twilio.twiml.messaging_response import MessagingResponse
from django.shortcut... | CaineArdayfio/ProjectUnicorn | texts/views.py | views.py | py | 8,866 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "twilio.rest.Client",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "texts.models.ProductCampaign.objects.get",
"line_number": 34,
"usage_type": "call"
},
{
"api_n... |
44757034205 | import unittest
import requests
from test_utils.json_utils import get_url
class TestServer(unittest.TestCase):
def test_post_network_training(self):
api_url = get_url()
payload = {'json': 'teste'}
api_output = requests.post(
f'{api_url}/trainings/', json=payload, verify=False)
... | Rene-Michel99/ml-manager | tests/endpoints/test_endpoint_training.py | test_endpoint_training.py | py | 668 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "test_utils.json_utils.get_url",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "test... |
27109197834 | import time
import sys
import os
import pygame
# import game object classes
from level import Level
from player import Player
from robot import Robot
from apple import Apple
# import constant definitions
from macros import *
# for mathematical operations
import numpy as np
class Game:
def __init__(self, ... | unlut/gameai_hw_final | hamham.py | hamham.py | py | 23,050 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "pygame.display.init",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "pygame.mixer.init",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.mixe... |
46749344987 | import time
import json
import random
import requests
from tqdm import tqdm
import pandas as pd
from bs4 import BeautifulSoup
'''
Workspace : Colab
It takes about 2 Hours 22 minutes to collect 300 reviews for each 10000 games.
get_n_appids(n=10000) takes about 15 minutes
more details in steam api 'reference' section i... | del-luna/steam_game_recommendation | crawler.py | crawler.py | py | 4,819 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": ... |
70571639903 | from pymongo import MongoClient
import pefile
import gridfs
import hashlib
client = MongoClient("mongodb://localhost:27017")
#connect to the files db
db = client.filesDB
grid_fs = gridfs.GridFS(db)
def start_cleanup(md5):
# step 1 - get file from gridfs
grid_fs_file = grid_fs.find_one({"md5": md5}... | eumitzi/bitdefender-project | server/workers/disinfect.py | disinfect.py | py | 1,104 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "gridfs.GridFS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pefile.PE",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_nu... |
8670148986 | from typing import List
class Solution:
data = [1, 2, 3, 4, 5, 6, 7, 8, 9]
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
res = []
self.back_trace(0, 9, res, [], k, n)
return res
def back_trace(self, start, total, res, path, k, n):
# 递归跳出条件
if len(p... | fadeawaylove/lulu_algorithm | 03_回溯法/codes/08_组合总和 III.py | 08_组合总和 III.py | py | 723 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
}
] |
4075784857 | from dataclasses import dataclass, field
from typing import List, Optional
from xsdata_ech.e_ch_0058_5_0 import HeaderType as HeaderType
from xsdata_ech.e_ch_0155_5_0 import (
ContestType as ContestType,
ElectronicBallotType as ElectronicBallotType,
ExtensionType as ExtensionType,
VoteType as VoteType,
... | seantis/xsdata-ech | src/xsdata_ech/e_ch_0159_5_0.py | e_ch_0159_5_0.py | py | 2,602 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "xsdata_ech.e_ch_0155_5_0.ContestType",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "dataclasses.field",
"line_number": 19,
"usage_type": "call"
},
{
"api_name":... |
72804371102 | from nets.resnet import ResNet50
from tensorflow.keras.utils import plot_model
from utils import load_image
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from tensorflow.keras import optimizers
import tensorflow as tf
if __name__ == "__main__":
gpus = tf.con... | xiaofeng1990/ResNet-50-Keras | train.py | train.py | py | 2,205 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "tensorflow.config.list_physical_devices",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.config",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.config.experimental.set_memory_growth",
"line_number": 12,
"usa... |
21458443958 |
import requests
import json
import logging
import logging.handlers
import os
from aliyunsdkcore import client
from aliyunsdkalidns.request.v20150109 import DescribeDomainRecordsRequest
from aliyunsdkalidns.request.v20150109 import UpdateDomainRecordRequest
KEY_FILE_NAME = 'key.json'
def ensure_dir(file_path):
... | luoy2/aliyun_ddns | main.py | main.py | py | 3,344 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.dirname",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
70049247584 | from time import sleep
from typing import Sequence, Optional, Tuple
from boltons.iterutils import first
from apiserver.apierrors import errors
from apiserver.config_repo import config
from apiserver.database.model import EntityVisibility
from apiserver.database.utils import id as db_id
from apiserver.tests.api_client... | glema-xmartlabs/clearml-server | apiserver/tests/automated/test_subprojects.py | test_subprojects.py | py | 11,769 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "apiserver.tests.automated.TestService",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "apiserver.tests.api_client.APIClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "apiserver.config_repo.config.get",
"line_number": 18,
"usage_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.