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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32909477589 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import time
import random
import decimal
from PySide2.QtWidgets import QApplication, QMessageBox, QWidget
from PySide2 import QtCore
from PySide2.QtUiTools import QUiLoader
from PyQt5.QtCore import QTimer
marry_date = '2020-07-06'
birth_date = '2022-01-22 ... | id10tttt/tools | qt_tools/compute_day.py | compute_day.py | py | 2,564 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 15,
"usage_type": "call"
},
{
"api_... |
72532696509 | """ Subsystem to communicate with catalog service
"""
import logging
from aiohttp import web
from pint import UnitRegistry
from servicelib.aiohttp.application_setup import ModuleCategory, app_module_setup
from . import _handlers
_logger = logging.getLogger(__name__)
@app_module_setup(
__name__,
ModuleCate... | ITISFoundation/osparc-simcore | services/web/server/src/simcore_service_webserver/catalog/plugin.py | plugin.py | py | 801 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "aiohttp.web.Application",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "aiohttp.web",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pint.UnitR... |
1293512231 | import inspect
from onnx import defs
from onnx.backend.test.runner import BackendIsNotSupposedToImplementIt
from onnx_jax.logger import logger
class Handler(object):
ONNX_OP = None
DOMAIN = defs.ONNX_DOMAIN
VERSION = 0
SINCE_VERSION = 0
@classmethod
def check_cls(cls):
if not cls.O... | gglin001/onnx-jax | onnx_jax/handlers/handler.py | handler.py | py | 1,679 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "onnx.defs.ONNX_DOMAIN",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "onnx.defs",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "onnx_jax.logger.logger.warning",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "o... |
1584126381 | # -*- coding: utf-8 -*-
import os
from django.utils.translation import ugettext_lazy as _
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from filer.settings import FILER_STATICMEDIA_PREFIX
from cmsplugin_filer_html5video.models import FilerHTML5Video
class FilerHTML5VideoPlugin(C... | beniwohli/cmsplugin-filer-html5video | cmsplugin_filer_html5video/cms_plugins.py | cms_plugins.py | py | 1,464 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "cms.plugin_base.CMSPluginBase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "cmsplugin_filer_html5video.models.FilerHTML5Video",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 15,
... |
36223514660 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 24 11:01:22 2023
@author: brand
"""
import math
import matplotlib.pyplot as plt
import numpy as np
timeStep = 0.01 #seconds
timeRange = np.arange(0,5,timeStep).tolist() # 20 seconds to take off
# reynolds is 200k
class Aircraft():
def __init__(self, weight, wingAvgCho... | Brandonh291/RC-Plane | Systems Engineering/Phase B - Preliminary Design and Technology Completition/Plane Take-off Sim.py | Plane Take-off Sim.py | py | 3,633 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.arange",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.radians",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "math.cos",
"line_number": 56,
... |
6701340278 | import cv2
import numpy as np
import imgaug.augmenters as iaa
import imgaug as ia
import torchvision
from torchvision import transforms
from PIL import Image, ImageEnhance, ImageOps
from RandAugment.augmentations import Lighting, RandAugment
class ResizeImage(object):
def __init__(self, height=256, width=256):
... | toandaominh1997/ProductDetectionShopee | datasets/augment.py | augment.py | py | 8,295 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "cv2.INTER_CUBIC",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.fromarray",
... |
41118007213 | import logging
import time
import traceback
from pathlib import Path
from requests_tracker.request import WebRequestType
from requests_tracker.session import WebSessionFactory
from requests_tracker.storage import convert_HAR_to_markdown, write_HAR_to_local_file, CookiesFileStorage
from requests_tracker.util import Log... | eladeon/requests-tracker-python | examples/scraper.py | scraper.py | py | 1,851 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests_tracker.util.LogHelper.configure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "requests_tracker.util.LogHelper",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "logging.DEBUG",
"line_number": 13,
"usage_type": "attribute"
... |
7166024264 | import pathlib
from typing import Any
import pytest
from competitive_verifier.models import (
AddtionalSource,
CommandVerification,
ConstVerification,
ResultStatus,
VerificationFile,
)
test_parse_VerificationFile_params: list[
tuple[VerificationFile, dict[str, Any], dict[str, Any]]
] = [
... | competitive-verifier/competitive-verifier | tests/models/test_file.py | test_file.py | py | 4,735 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "competitive_verifier.models.VerificationFile",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "competitive_verifier.models.VerificationFile",
"line_number": 18,
"usage_type": "... |
2077956577 |
from odoo import models, api, fields, _
# from odoo.exceptions import UserError
from datetime import datetime
from dateutil.relativedelta import relativedelta
import json
import xlsxwriter
_
from odoo.exceptions import ValidationError
from odoo.exceptions import UserError
import base64
import io
tr... | Odolution/lacas | ol_lacas_custom_recovery_report/wizard/custom_wizard.py | custom_wizard.py | py | 8,991 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "odoo._",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.models.Model",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char",
"line... |
43536075224 | import requests
import json
import os
import sys
import logging
logger = logging.getLogger(__name__)
def gdc_read_file(file_id="11443f3c-9b8b-4e47-b5b7-529468fec098"):
data_endpt = "https://api.gdc.cancer.gov/slicing/view/{}".format(file_id)
TOKEN_FILE_PATH = os.environ.get('GDC_TOKEN')
if not TOKEN_FIL... | neksa/mutagene | mutagene/io/gdc.py | gdc.py | py | 807 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_... |
32724523948 | import tornado.ioloop
import tornado.web
import hashlib
import uuid
import json
from time import mktime
from datetime import datetime
from email.utils import formatdate
up_user = ''
up_password = ''
up_method = 'PUT'
up_host = 'v1.api.upyun.com'
up_path = '/bucket/'
up_base_url = "http://bucket.b0.upaiyun.com/%s"
... | zhicheng/storage | main.py | main.py | py | 1,410 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "tornado.ioloop.web",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tornado.ioloop",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "time.mktime",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.... |
16838640248 | import pytest
import requests_mock
from csvcubed.utils.cache import session
from csvcubed.definitions import ROOT_DIR_PATH
@pytest.fixture(scope="package", autouse=True)
def mock_http_session_qube_config_schema():
"""
Fixture which mocks the HTTP responses of the JSON qube-config schema file for testing.
... | GDonRanasinghe/csvcubed-models-test-5 | csvcubed/tests/unit/readers/cubeconfig/v1_0/conftest.py | conftest.py | py | 844 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csvcubed.utils.cache.session.cache_disabled",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "csvcubed.utils.cache.session",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "requests_mock.Mocker",
"line_number": 14,
"usage_type": "call"
... |
33875335541 | import torch
import wandb
from .utils import matrix_to_dict
class Logger(object):
def __init__(self, hparams, model) -> None:
super().__init__()
self.hparams = hparams
self._setup_exp_management(model)
self.total_loss_values = None
def _setup_exp_management(self, model):
... | rpatrik96/nl-causal-representations | care_nl_ica/logger.py | logger.py | py | 1,456 | python | en | code | 12 | github-code | 6 | [
{
"api_name": "wandb.init",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "wandb.watch",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "wandb.define_metric",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "wandb.define_metric",
... |
10368808313 | from . import get_help
__doc__ = get_help("help_autoban")
from telethon import events
from pyUltroid.dB.base import KeyManager
from . import LOGS, asst, ultroid_bot, ultroid_cmd
Keym = KeyManager("DND_CHATS", cast=list)
def join_func(e):
return e.user_joined and Keym.contains(e.chat_id)
async def dnd_func(... | TeamUltroid/Ultroid | plugins/autoban.py | autoban.py | py | 1,550 | python | en | code | 2,615 | github-code | 6 | [
{
"api_name": "pyUltroid.dB.base.KeyManager",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "telethon.events.ChatAction",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "telethon.events",
"line_number": 41,
"usage_type": "name"
},
{
"api_name"... |
19882697980 | import os
import trio
import ssl
from async_generator import asynccontextmanager
from structlog import get_logger
from typing import Optional, Union
from guardata.crypto import SigningKey
from guardata.api.transport import Transport, TransportError, TransportClosedByPeer
from guardata.api.protocol import (
DeviceI... | bitlogik/guardata | guardata/client/backend_connection/transport.py | transport.py | py | 6,416 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "structlog.get_logger",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "typing.Union",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "guardata.client.types.BackendAddr",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "g... |
72532004029 | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from copy import deepcopy
import pytest
from pytest import MonkeyPatch
from settings_library.docker_registry import RegistrySettings
MOCKED_BASE_REGISTRY_ENV_VARS: dict[str, str] = {
"REGISTRY_AUTH": "False",
"REGISTRY_USER": "usr",
... | ITISFoundation/osparc-simcore | packages/settings-library/tests/test_docker_registry.py | test_docker_registry.py | py | 1,754 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "copy.deepcopy",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pytest.MonkeyPatch",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "pytest.MonkeyPatch",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "settings_library.... |
32060115586 | import torch
from torch import nn
from torchvision import models, transforms
class VGG16Extractor(nn.Module):
def __init__(self):
super(VGG16Extractor, self).__init__()
vgg = models.vgg16(pretrained=True)
features = vgg.features
self.relu_1_2 = nn.Sequential()
self.relu_2... | harsh020/image-colorization | colorizer/utils.py | utils.py | py | 1,588 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "torchvision.models.vgg16",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torchvision.mode... |
9384835860 | import argparse
from click import secho
import sys
from DNScanner.DNScanner import DNScanner
savesys = sys.stdout
# Flags
parser = argparse.ArgumentParser(description='\t Scan domains https://github.com/ChinadaCam/DNScanner')
parser.add_argument('-d', '--domain', required=True, type=str, help='Set domain (example.c... | ChinadaCam/DNScanner | start.py | start.py | py | 2,894 | python | en | code | 9 | github-code | 6 | [
{
"api_name": "sys.stdout",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "DNScanner.DNScanner.DNScanner",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "... |
11474271839 | '''
Created on Jan 9, 2010
@author: eric
'''
import asyncore
import socket
import time
from ParsedMessage import ParsedMessage
class Connection(asyncore.dispatcher):
'''
maintains the connection to the server
'''
buffer = ""
bytesIn = 0
bytesOut = 0
connectionAttempts = 0
reconn... | ericbutera/pyib | src/Pyib/Connection.py | Connection.py | py | 3,734 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "asyncore.dispatcher",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "asyncore.dispatcher.__init__",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "asyncore.dispatcher",
"line_number": 29,
"usage_type": "attribute"
},
{
"ap... |
74883082427 | from collections import defaultdict
class UnionFind():
def __init__(self, n):
# 頂点の値が0から始まる前提なので注意
self.par = [i for i in range(n)]
def root(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.root(self.par[x])
return self.par[x... | kazuo-mu/at_coder_answers | ABC049/d_connectivity.py | d_connectivity.py | py | 1,393 | python | ja | code | 0 | github-code | 6 | [
{
"api_name": "collections.defaultdict",
"line_number": 49,
"usage_type": "call"
}
] |
38831023014 | from hyperopt import hp, STATUS_OK
import numpy as np
from mne.filter import resample
from crossvalidate import crossvalidate,test_ensamble,test_naive, run_a_trial
from keras.utils import to_categorical
import keras.backend as K
import uuid
from utils import save_results,get_subj_split
from my_models import ShallowCo... | bkozyrskiy/NN_hyperopt_search | opt_shallow.py | opt_shallow.py | py | 3,725 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
34225982423 | #This file is part of Chess-game-tracker.
#Chess-game-tracker is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#Chess-game-tracker is dis... | nandovm/chess-game-tracker | Chess-game-tracker/multithread/Capturer.py | Capturer.py | py | 2,793 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.version_info",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "Queue.Queue",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "threading.Thread",... |
26626826683 | # Import the qrcode library
import qrcode
# Create a qr code instance
qr = qrcode.QRCode(
version = 1,
error_correction = qrcode.constants.ERROR_CORRECT_L,
box_size = 10,
border = 4,
)
# The data that you want to encode
data = "192.168.1.19:8765"
# Add the data
qr.add_data(data)
qr.make(fit=True)
# ... | Gex-devs/val_overlay | ts/BackUp_Local_Api_py/QRcode.py | QRcode.py | py | 564 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "qrcode.QRCode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "qrcode.constants",
"line_number": 7,
"usage_type": "attribute"
}
] |
73573190267 | import pymysql
from dbutils.pooled_db import PooledDB
class MysqlPool:
config = {
'creator': pymysql,
'host': "127.0.0.1",
'port': 3306,
'user': "tron",
'password': "123456",
'db': "vecrv_sun_airdrop_claimed",
'charset': 'utf8',
'maxconnections': 70,... | dpneko/pyutil | mysql_client.py | mysql_client.py | py | 5,065 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "pymysql.cursors",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dbutils.pooled_db.PooledDB",
"line_number": 16,
"usage_type": "call"
}
] |
4510504745 | from tkinter import *
import tkinter as tk
import sqlite3
import sys
print("Imported")
con = sqlite3.connect("project.db")
print("Connected")
root = tk.Tk()
v = tk.IntVar()
v1 = tk.IntVar()
v2 = tk.IntVar()
v3 = tk.IntVar()
def createtable():
create = ("CREATE TABLE IF NOT EXISTS vehicle(NAME VARCHAR(200),"+
... | karankhat/Vehicle_Rental_Agency | python.py | python.py | py | 14,870 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tkinter.IntVar",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.IntVar",
"line_n... |
33317389259 | import pandas as pd
import streamlit as st
import folium
from streamlit_folium import st_folium
st.title("Peta Nilai Properti Kota Tangerang")
st.markdown("Sumber Data: Pusat Pembinaan Profesi Keuangan")
st.markdown("")
# Load data
df_tangcity = pd.read_csv('df_property.csv')
# Set up map
tangcity_map = f... | danarssidig/propertymap | property_map.py | property_map.py | py | 2,935 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "streamlit.title",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "streamlit.markdown",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
9345123435 | from datetime import datetime
from elasticsearch_dsl import DocType, Date, Nested, Boolean, \
analyzer, InnerObjectWrapper, Completion, Keyword, Text
from elasticsearch_dsl.analysis import CustomAnalyzer as _CustomAnalyzer
from elasticsearch_dsl.connections import connections
connections.create_connection(hosts=["... | XiaoShenLong/scrapy-search | baike_spider/baike/models/es_types.py | es_types.py | py | 1,703 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "elasticsearch_dsl.connections.connections.create_connection",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "elasticsearch_dsl.connections.connections",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "elasticsearch_dsl.analysis.CustomAnalyzer",
... |
3774041977 | #!/usr/bin/env python
import argparse
import yaml
import sys
import http.server
import http.client
import requests
configFile = 'config.yaml'
configDefault = {'server': {'host': "127.0.0.1", 'port': 2323},
'proxies': None,
'forwarder': {'host': "127.0.0.1", 'headers': ["Content-Type"... | ecator/http-forwarder | http-forwarder.py | http-forwarder.py | py | 6,296 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "http.server.client",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "http.server",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "http.server.server",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "http.serv... |
33562211468 | import cv2
import numpy as np
def contraste(inp):
f,c,color=inp.shape
c1=np.min(inp)
d=np.max(inp)
for i in range(f):
for j in range(c):
inp[i][j][0]=round((inp[i][j][0]-c1)*((255)/(d-c1)))
inp[i][j][1]=round((inp[i][j][1]-c1)*((255)/(d-c1)))
inp[i][... | renzovc987/CG | multipliacion.py | multipliacion.py | py | 1,313 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.min",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "cv2.resize",
"line_number": 41,
... |
277948458 | import torch
import torch.nn as nn
from shapmagn.global_variable import Shape
from shapmagn.utils.obj_factory import obj_factory
from shapmagn.modules_reg.module_gradient_flow import gradient_flow_guide
from shapmagn.shape.point_sampler import point_fps_sampler
class GradFlowPreAlign(nn.Module):
def __init__(self... | uncbiag/shapmagn | shapmagn/modules_reg/module_gradflow_prealign.py | module_gradflow_prealign.py | py | 12,227 | python | en | code | 94 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "shapmagn.shape.point_sampler.point_fps_sampler",
"line_number": 31,
"usage_type": "call"
},
{
"api_na... |
73726701627 | from django.shortcuts import render
from .models import Post, Categories
# Create your views here.
def blog(request):
post = Post.objects.all()
cat = [i.categories.all()[0] for i in post]
cat = list(set(cat))
return render(request, 'blog/blog.html',
{'posts': post, 'categories': cat}... | rebecalvarezc/django_clases | firstWeb/blogApp/views.py | views.py | py | 596 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "models.Post.objects.all",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "models.Post.objects",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "models.Post",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.shor... |
12877884293 | from sklearn import datasets
from sklearn.preprocessing import MaxAbsScaler
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, confusion_matrix, classification_report
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.linear_model import LogisticRegressi... | abhi-baireddy/IRProject | left_right_classifier.py | left_right_classifier.py | py | 5,085 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sklearn.datasets.load_svmlight_file",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "numpy.mean",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklea... |
18244520374 | import json
from datetime import datetime, timedelta
from news_utilities import add_news
cache_file = '/home/pi/AlarmClockProject/AlarmClock/cache/calendars/' + 'cal_ed.json'
homeworks = None
calendar = None
notes = None
datetime_now = datetime.now()
def str_to_datetime(date_str):
if len(date_str) == 16:
... | cg-Kdaf/RPIAlarmClock | src/ED_utilities.py | ED_utilities.py | py | 4,112 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "datetime.datetime.now",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
43085107371 | #!/bin/env python
import numpy as np
from matplotlib import pyplot as plt
import argparse
import sys
import parse_ats
def load(fname, density):
dat = np.loadtxt(fname) # units s, mol/s
dat[:,0] = dat[:,0] / 86400. # convert to days
dat[:,1] = dat[:,1] / density * 86400 # convert to m^3/d
return dat
d... | amanzi/ats | tools/utils/plot_runoff.py | plot_runoff.py | py | 2,293 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "numpy.loadtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "parse_ats.re... |
34408932008 | from flask_restplus import Resource
from flask import current_app as cur_app
from flask import request
from app.main.services.story.brand_story_services import duplicate_story, get_all_draft_or_published_story, get_story, issue_story_template_before_save, post_story_publish_and_draft, remove_story_from_search, update_s... | deepakarya09/cureas_reads | app/main/controllers/api_story_controller.py | api_story_controller.py | py | 3,300 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.main.utils.api_story_dto.BrandStoryDTO.api",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.main.utils.api_story_dto.BrandStoryDTO",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.main.utils.api_story_dto.BrandStoryDTO.res_issue... |
29806901602 | import os
from dataclasses import dataclass
from datetime import datetime
from fastapi.encoders import jsonable_encoder
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import joinedload
from MenuApp.src.models import Menu, Submenu
@dataclass
class ReportService:
... | Aliakseeva/MenuApp | MenuApp/src/services/tasks/report_service.py | report_service.py | py | 2,538 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.select",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "MenuApp.src.models.Menu",
"line_number": 23,
"usage_type": "argument"
},
{
... |
72908363068 | # -*- coding: utf-8 -*-
from odoo import models, fields, api, _
from dateutil.relativedelta import relativedelta
from odoo.exceptions import ValidationError, UserError
from datetime import datetime, timedelta
from odoo.http import request
class OpAdmissionRegisterCustom(models.Model):
_inherit = "op.admi... | mrrtmob/odoo_acac | local-addon/pm_admission/models/pm_admission.py | pm_admission.py | py | 30,867 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "odoo.models.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Many2one",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
... |
41119379113 | import random
random.seed(1)
import numpy as np
np.random.seed(1)
import tensorflow.compat.v1 as tf
tf.random.set_random_seed(1)
import gym
import os
tf.disable_v2_behavior()
env = gym.make('CartPole-v1')
class PolicyNetwork:
def __init__(self, state_size, action_size, learning_rate, name='policy_network'):
... | eladfeld/DRL_hw | hw2/actor_critic.py | actor_critic.py | py | 7,669 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.compat.v1.ran... |
14875088196 | import bpy
import bmesh
import sys
import time
import argparse
# blender -b -P Resize.py -- --height 0.8 --inm Objects/Bed.obj --outm oBed2.obj
def get_args():
parser = argparse.ArgumentParser()
# get all script args
_, all_arguments = parser.parse_known_args()
double_dash_index = all_arguments.index('--... | Niloofar-didar/AR-Realtime-Decimation-main | eAR-offline_modeling/Resize.py | Resize.py | py | 1,784 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bpy.ops.object.select_all",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "bpy.ops",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "bpy.op... |
18298344467 | import argparse
import socket
import struct
import codecs
import dns.resolver
import dns.message
import dns.query
import base64
from aes import aes
# Address of the DNS server
#dns_server = "8.8.8.8"
# DNS query message format
#dns_query = struct.pack("!6H", 0x1234, 1, 1, 0, 0, 0) + b"\x03foo\x03bar\x00... | unicycling-amphibian/CovertDNS | DNSCovert_Client.py | DNSCovert_Client.py | py | 9,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aes.aes.new",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "aes.aes",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "aes.aes.MODE_ECB",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "base64.b64encode",
"lin... |
19052604441 | import json
import snappy
from structlog import get_logger
from jwcrypto.common import base64url_decode
from app.data_model.app_models import QuestionnaireState
from app.storage import data_access
from app.storage.storage_encryption import StorageEncryption
logger = get_logger()
class EncryptedQuestionnaireStorage... | ONSdigital/census-survey-runner | app/storage/encrypted_questionnaire_storage.py | encrypted_questionnaire_storage.py | py | 2,887 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "structlog.get_logger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "app.storage.storage_encryption.StorageEncryption",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "snappy.compress",
"line_number": 25,
"usage_type": "call"
},
{
... |
36181808903 | """
gradient descent 연습
"""
import matplotlib.pyplot as plt
from scratch08.ex01 import difference_quotient, tangent, move
def g(x):
"""y = (1/3)x**3 - x"""
return x ** 3 / 3 - x
if __name__ == '__main__':
# ex01에서 작성한 함수를 이용, 함수 g(x)의 그래프를 그림
# 극값(local 최소/최대)를 경사 하강법으로 찾음
xs = [x / 10 for x in ... | lee-saint/lab-python | scratch08/ex02.py | ex02.py | py | 1,510 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axhline",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ma... |
14349515929 | import numpy as np
# import packages
from PIL import Image
import pytesseract
import argparse
import cv2
import os
import re
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("--image", required=True,
help="path to input image to be OCR'd")
ap.add_argument("-p", "--... | guessthepartei/App | magic/parse.py | parse.py | py | 2,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "cv2.threshold",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "cv2.THRESH_TOZERO",
... |
29876271313 | # pylint: disable=invalid-name, unused-argument, unspecified-encoding, missing-function-docstring
"""
Implements all winreg functions
https://docs.python.org/3/library/winreg.html#functions
"""
import os
from typing import Union
from re import findall
from tempfile import TemporaryDirectory
from warnings import warn
f... | Jan200101/unixreg | unixreg/functions.py | functions.py | py | 6,498 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.Union",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "unixreg.key.RegKey",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "unixreg.key.RegKey",
... |
35920335524 | import requests
from bifocal import utils, models
from polo import Polo
from coindesk import Coindesk
class Blockscan(object):
@staticmethod
def _request(**kwargs):
uri = 'http://xcp.blockscan.com/api2?%s' % utils.encode_args(kwargs)
ret = requests.get(uri)
return utils.parse_json(ret... | super3/bifocal | bifocal/apis/blockscan.py | blockscan.py | py | 1,672 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "bifocal.utils.encode_args",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bifocal.utils",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bifocal.utils.pa... |
16606388338 | from rich import print
from napalm import get_network_driver
from my_devices import arista1, arista2, arista3, arista4
def main():
for device in (arista1, arista2, arista3, arista4):
driver = get_network_driver('eos')
with driver(**device) as device:
device.open()
... | caseymorris87/pynet_test2 | napalm/ex2.py | ex2.py | py | 839 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "my_devices.arista1",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "my_devices.arista2",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "my_devices.arista3",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "my_devices.aris... |
6547068714 | """
Tests for Randomized Reconstruction Commands
"""
import unittest
import requests
import sys
import os
import importlib
from pathlib import Path
import json
# Add the client folder to sys.path
CLIENT_DIR = os.path.join(os.path.dirname(__file__), "..", "client")
if CLIENT_DIR not in sys.path:
sys.path.append(C... | albertotono/Fusion360GalleryDataset | tools/fusion360gym/test/test_fusion360gym_randomized_reconstruction.py | test_fusion360gym_randomized_reconstruction.py | py | 6,122 | python | en | code | null | github-code | 6 | [
{
"api_name": "os.path.join",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
26306025238 | #!/usr/bin/python3
"""Use reddit api to get info about subredit subscribers"""
def number_of_subscribers(subreddit):
"""Return number of subscribers in subreddit given as argument"""
import requests
url = 'https://www.reddit.com/r/{}/about.json'.format(subreddit)
headers = {'user-agent': 'andy'}
... | AndyMSP/holbertonschool-system_engineering-devops | 0x16-api_advanced/0-subs.py | 0-subs.py | py | 496 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
20105217581 | #https://towardsdatascience.com/how-to-perform-lasso-and-ridge-regression-in-python-3b3b75541ad8
import numpy as np
import pandas as pd
#we only have three advertising mediums, and sales is our target variable.
DATAPATH = 'Advertising.csv'
data = pd.read_csv(DATAPATH)
print(data.head())
data.drop(['Unnamed: 0'], axis=... | eyadwin/Machine_Learning | regularization_lasso_regression.py | regularization_lasso_regression.py | py | 1,396 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearRegression",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.cross_val_score",
"line_number": 21,
"usage_type": "call"
... |
1584185561 | # This is mostly lifted from django-storages' sftp backend: Their license:
#
# SFTP storage backend for Django.
# Author: Brent Tubbs <brent.tubbs@gmail.com>
# License: MIT
#
# Modeled on the FTP storage by Rafal Jonca <jonca.rafal@gmail.com>
from __future__ import print_function
try:
import ssh
except ImportError:... | beniwohli/django-localdevstorage | localdevstorage/sftp.py | sftp.py | py | 3,964 | python | en | code | 50 | github-code | 6 | [
{
"api_name": "localdevstorage.base.BaseStorage",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "warnings.warn",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "django.conf.settings.LOCALDEVSTORAGE_SFTP_HOST",
"line_number": 35,
"usage_type": "attribu... |
6827571219 | """ https://adventofcode.com/2020/day/17 """
from typing import List
from copy import deepcopy
from functools import lru_cache
def part1(data: List[str]) -> int:
""" O(n) solution """
size_x = len(data[0]) + 2 * CYCLES
size_y = len(data) + 2 * CYCLES
size_z = CYCLES * 2 + 1
pocket = [[[False] *... | pozhega/AoC | 2020/d17.py | d17.py | py | 3,804 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number... |
21837055614 | """Parsing url to check its SEO and availability"""
from datetime import date
from bs4 import BeautifulSoup
def get_page_data(response):
"""Check SEO functionality of url"""
result = {'status_code': response.status_code}
page = BeautifulSoup(response.text, 'html.parser')
result['h1'] = page.h1.get_... | GunGalla/python-project-83 | page_analyzer/parse_url.py | parse_url.py | py | 628 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "datetime.date.today",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 21,
"usage_type": "name"
}
] |
73819284349 | import numpy as np
import dill
import math
import sys
sys.path.append('../')
sys.path.append('./')
from src.graph import Graph
from src.evolution_strategies import one_plus_lambda, tournament_selection
from src.population import Population
from src.arg_parser import parse_args
import cProfile
import pstats
def bool_a... | fhtanaka/CGPython | tests/diversity_parity_test.py | diversity_parity_test.py | py | 3,954 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_numbe... |
13394323895 | # -*- coding: utf-8 -*-
"""This module loads images from csv files and outputs numpy arrays"""
from __future__ import absolute_import, division, print_function
from copy import deepcopy
import numpy as np
import tensorflow as tf
from six import string_types
import niftynet.utilities.util_csv as util_csv
from niftyne... | LUYU0004/ISLES2018-1 | lib/niftynet/io/image_reader.py | image_reader.py | py | 10,262 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tensorflow.float32",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.float32",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.float32",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name"... |
14405820391 | # coding=utf-8
from django.contrib.admin import ModelAdmin, site
from models import News
class NewsAdmin(ModelAdmin):
list_display = ('id', 'match_type', 'game_start_time', 'end_score', 'middle_score', 'status', 'team1', 'score',
'team2', 'yapan','yapanSB', 'daxiaopan','daxiaopanSB', 'findex'... | xiaoqiu206/football | spider/admin.py | admin.py | py | 507 | python | en | code | 36 | github-code | 6 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.News",
"line_number": 14,
"usage_type": "argument"
},
{
... |
74798420027 | import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.cm import get_cmap
data = pd.read_csv("./output_geo.csv")
df = pd.DataFrame(data)
fig, ax = plt.subplots()
# get a color map
cmap = get_cmap("tab20", 28) # type: matplotlib.colors.ListedColormap
colors = cmap.colors # type: list
ips = df['ip']
me... | LisandroDiMeo/tp_traceroute | create_graph_rtt.py | create_graph_rtt.py | py | 499 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "matplotlib.p... |
15211930040 | """
Perform Outlier Rejection with MCMC
-----------------------------------
Figure 8.9
Bayesian outlier detection for the same data as shown in figure 8.8. The
top-left panel shows the data, with the fits from each model. The top-right
panel shows the 1-sigma and 2-sigma contours for the slope and intercept with
no ou... | astroML/astroML_figures | book_figures/chapter8/fig_outlier_rejection.py | fig_outlier_rejection.py | py | 8,174 | python | en | code | 7 | github-code | 6 | [
{
"api_name": "astroML.plotting.setup_text_plots",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": ... |
8266559866 | import copy
import logging
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, NamedTuple, Union
import yaml
import cekit
from cekit.cekit_types import _T, RawDescriptor
from cekit.config import Config
from cekit.descriptor import (
Arg,
Descriptor,
Env,
La... | cekit/cekit | cekit/descriptor/image.py | image.py | py | 19,524 | python | en | code | 70 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "cekit.config.Config",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "yaml.safe_... |
73266752189 | import cv2
import numpy as np
from scipy import signal
import math
import matplotlib.pyplot as plt
if __name__ == "__main__":
gauss_blur_filter = [[0 for x in range(3)] for y in range(3)]
gauss_blur_filter[0][0] = 1/16
gauss_blur_filter[0][1] = 1/8
gauss_blur_filter[0][2] = 1/... | Srivenkat1995/Image-Segmentation-and-Point-Detection | task2.py | task2.py | py | 2,305 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.float",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "cv2.copyMakeBorder",
"lin... |
70078277628 | import numpy as np
import torch
import os
import yaml
import tqdm
from addict import Dict
from collections import defaultdict
from matplotlib import pyplot as plt
import matplotlib.patches as patches
import pickle
import random
import pytorch_ssim
from skimage.measure import compare_ssim as ssim
from train import buil... | azadef/interactive_scene_generation | evaluate_vg.py | evaluate_vg.py | py | 18,847 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.isfile",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "scene_generation.args.get_args",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "torch.manu... |
37681820103 | import pygame
from configs import ColorConfig
class Button(object):
def __init__(self, x_coordinate: int, y_coordinate: int, button_width: int,
button_height: int, text_font: str, text_size: str,
button_name: str, onclick_function=None):
self.x = x_coordinate
se... | pavst23/project_game | elements/button.py | button.py | py | 1,452 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.Surface",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pygame.Rect",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.font.SysFont",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"lin... |
40197352017 | from django.urls import path
from . import views
app_name = "Employees"
urlpatterns = [
path('profile', views.profile, name="profile"),
path('edit_profile', views.editprofile, name="edit_profile"),
path('check_employee', views.checkemployee, name="check_employee"),
path('employee_position', views.emp... | jakubbm/employees-management | Employees/urls.py | urls.py | py | 615 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
42269789956 | from .models import *
from .forms import *
from app import filtersets
import cx_Oracle
from django.http.response import Http404
from django.shortcuts import render, redirect
from django.contrib.auth import login
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
... | maxquevedo/safelyWeb | safely/app/views.py | views.py | py | 21,095 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "django.http.HttpResponseRedirect",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.views.decorators.staff_member_required",
"line_number": 35,
"usage_... |
28521286035 | """Added instructions html to make instructions dynamic
Revision ID: 6a1ef6fabfaf
Revises: 1c8b21137307
Create Date: 2017-08-12 01:36:17.185403
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6a1ef6fabfaf'
down_revision = '... | harveyslash/backend-cleaned | beatest/migrations/versions/0005_6a1ef6fabfaf_added_instructions_html_to_make_.py | 0005_6a1ef6fabfaf_added_instructions_html_to_make_.py | py | 748 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.dialect... |
14095456258 | # Aditya Halder // @AdityaHalder
import os
import aiofiles
import aiohttp
import ffmpeg
import requests
from os import path
from asyncio.queues import QueueEmpty
from typing import Callable
from pyrogram import Client, filters
from pyrogram.types import Message, Voice, InlineKeyboardButton, InlineKeyboardMarkup
from p... | ndika22/KaalMusic | plugins/vcbot.py | vcbot.py | py | 8,167 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ffmpeg.input",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "pyrogram.types.Message",
"line_number": 69,
"usage_type": "name"
},
{
"api_name": "modules.helpers.admins.... |
3562737092 | from modules import s3upload, s3transcribe, parse
import argparse
if __name__ == "__main__":
# Create Argument Parser
parser = argparse.ArgumentParser(description='Process video, create transcripts, proofread with OpenAI GPT.')
parser.add_argument('input_folder', type=str, help='Input folder with .mp4 inte... | uitrial/Interview-Transcribe-Proofread | process_transcripts.py | process_transcripts.py | py | 1,168 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "modules.s3upload.upload_to_s3",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "modules.s3upload",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": ... |
31019892466 | import json
import re
import os
from bs4 import BeautifulSoup
import io
import html2text
#import transformationScript
import datetime
#from pprint import pprint
class Word:
content = ""
tag = ""
# The class "constructor" - It's actually an initializer
def __init__(self, content, tag):
self.co... | fspring/NeuralArgMining | Translators/Portuguese/TransFormationScriptComplete.py | TransFormationScriptComplete.py | py | 17,944 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 85,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 97,
"... |
17203277817 | #Pasos a seguir:
#1) Installar el repostorio de proyecto EELabs, con .env y credentials.json en \resources_folder\google, y el entorno conda
#2) Pegar este script en dentro del repositorio \
#3) Ejecutar desde su ubicacion
#IMPORTANTE no permite realizar actualizaciones de fecha, está pensado para una descarga úni... | mt4sd/EELabs_paper | Download_data/Photometer_data/Download_EELabs_photometers.py | Download_EELabs_photometers.py | py | 11,585 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 56,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"l... |
19876190982 | #!/usr/bin/python3
import os
import argparse
from subprocess import call
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('basedir', type=str, help='The base directory to walk from')
args = parser.parse_args()
print('The base dir is: {}'.format(args.basedir))
for d... | ruizhang84/B565-Data-Mining | src/preprocess/scripts/decompress.py | decompress.py | py | 688 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numbe... |
36153558414 | import unittest
import datetime
import json
from app.textsapi.models.submission import Submission
from app.textsapi.models.text import Text
from app.tests.base import BaseTestCase
def register_ok_submission(self, token):
return self.client.post(
'/submission/',
headers=dict(
Authorizat... | jkausti/flask-textsapi | app/tests/_test_submission_controller.py | _test_submission_controller.py | py | 3,468 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "json.dumps",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "app.tests.base.BaseTestCase",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "json.loads",
"l... |
36397304694 | """
Table of Contents
1. drop_null_columns: Drop columns that exceed a threshold of null values.
"""
from pyspark.sql import functions as F, DataFrame
from ..parsing.melting import melt
def drop_null_columns(df: DataFrame, threshold: float = 1.0, subset: list = None) -> DataFrame:
"""
Drop columns that exc... | phil-trinh/pyspark_utilities_sample | transformations/calculations/null_funcs.py | null_funcs.py | py | 2,241 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyspark.sql.DataFrame",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pyspark.sql.functions.when",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "pyspark.sql.functions",
"line_number": 39,
"usage_type": "name"
},
{
"api_name":... |
39188602086 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from blog import apiviews
router = DefaultRouter()
router.register('posts', apiviews.PostViewSet)
router.register('comments', apiviews.CommentViewSet)
router.register('replies', apiviews.ReplyViewSet)
router.register('users', apivie... | MahfuzKhandaker/blogapi | blog/urls.py | urls.py | py | 736 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "blog.apiviews.PostViewSet",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "blog.apiviews",
"line_number": 6,
"usage_type": "name"
},
{
"ap... |
1433290010 | import pytest
import stk
from .case_data import CaseData
@pytest.fixture(
scope="session",
params=(
lambda name: CaseData(
molecule=stk.BuildingBlock("C1=CC=CC=C1"),
sub_group_data={
"c6_planarity": [2.7518147481201438e-06],
"c5n1_planarity": []... | JelfsMaterialsGroup/stko | tests/molecular/subgroup/conftest.py | conftest.py | py | 1,311 | python | en | code | 18 | github-code | 6 | [
{
"api_name": "pytest.fixture",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "case_data.CaseData",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "stk.BuildingBlock",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "case_data.CaseData... |
655866557 | from __future__ import annotations
import contextlib
import inspect
import os
import time
import warnings
from collections import OrderedDict
from importlib import import_module
from typing import Any, Callable, Dict, Optional, Union
import numpy as np
import torch
import torch.cuda.amp as amp
from tqdm import tqdm
... | constantinpape/torch-em | torch_em/trainer/default_trainer.py | default_trainer.py | py | 29,151 | python | en | code | 42 | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "torch.utils",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.utils",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"lin... |
12110709697 | import numpy as np
from tqdm import tqdm
flip_inst = {}
flip_inst['e'] = [1, 0]
flip_inst['w'] = [-1, 0]
flip_inst['se'] = [0, -1]
flip_inst['sw'] = [-1, -1]
flip_inst['ne'] = [1, 1]
flip_inst['nw'] = [0, 1]
def flip_tile(instr, tiles):
tile = np.array([0, 0])
while instr:
for fi, dir in flip_inst.it... | scjohnson/aoc_2020 | solution_24.py | solution_24.py | py | 2,048 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": ... |
73154395388 | import os
import pickle
import argparse
import torch
import torch.optim as optim
from torch.utils.data import DataLoader
from Model.INPLIM import Doctor
from data_utils import CodeLevelDataset
from utils import train_eval
def args():
parser = argparse.ArgumentParser()
parser.add_argument('--data_root', type=s... | xlbryantx/INPLIM | main.py | main.py | py | 4,064 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 44,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "data_utils.CodeLe... |
2052216012 | from fastai import vision, metrics
from fastai.callback import hooks
from fastai.utils import mem
import numpy as np
from os import path
import torch
vision.defaults.device = vision.defaults.device if torch.cuda.is_available() else torch.device('cpu')
# Download data and get path
fastai_path = vision.untar_data(visio... | lykhahaha/Mine | Fastai_Tutorial/lesson3-camvid.py | lesson3-camvid.py | py | 3,776 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastai.vision.defaults",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "fastai.vision",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.... |
26349073306 | import functools
from enum import Enum
import json
import re
class SCJDEntry:
def __init__(self):
self.data = {}
def set_title(self, title):
self.data['title'] = title
def set_id(self, idx):
self.data['idx'] = idx
def glue_pronounce(self, prn):
if 'prn' in self.data:
self.data['prn'] += prn
else:
... | Leundo/apple-dictionary-extractor | ADParser/scjd_controller.py | scjd_controller.py | py | 17,976 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "enum.Enum",
"line_number": 134,
"usage_type": "name"
},
{
"api_name": "enum.Enum",
"line_number": 162,
"usage_type": "name"
},
{
"api_name": "functools.wraps",
"line_number": 403,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number":... |
32796024261 | from gevent import monkey
monkey.patch_all()
import gevent
import socket
import re
import dns
import log
LOG = log.get_logger('dns-proxy')
class DNSServer(object):
def __init__(self, host='0.0.0.0', port=53, nameserver='114.114.114.114'):
self.sock = None
self.host = host
self.port = port... | PeerXu/death-star | death_star/dns_proxy.py | dns_proxy.py | py | 3,334 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "gevent.monkey.patch_all",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "gevent.monkey",
"line_number": 2,
"usage_type": "name"
},
{
"api_name": "log.get_logger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "socket.socket",
... |
14504710213 | import os
import numpy as np
import pandas as pd
from PIL import Image
from collections import Counter
import torch
from torch.utils.data import Dataset
from torch.nn.utils.rnn import pad_sequence
import torchvision.transforms as T
import spacy
spacy_eng = spacy.load("en_core_web_sm")
# defining the transform to be... | danarip/ImageCaptionGenerator | source/data_preprocessing.py | data_preprocessing.py | py | 5,555 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "spacy.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms.Compose",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "torc... |
33195061509 | import numpy as np
import cv2
import copy
from time import sleep
import datetime
# from progress.bar import Bar
def Rodar(cam):
capture = cv2.VideoCapture(cam)
background_subtractor = cv2.bgsegm.createBackgroundSubtractorMOG()
#length = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
# bar = Bar('Processi... | rnanc/MOBYDATA | services/motion_heatmap.py | motion_heatmap.py | py | 2,177 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.VideoCapture",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "cv2.bgsegm.createBackgroundSubtractorMOG",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.bgsegm",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_nam... |
38586292194 | import cv2
import numpy as np
img = cv2.imread('images/saitama.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) # convert it to hsv
width = img.shape[1]
height = img.shape[0]
channel = img.shape[2]
increase_v = 40
decrease_s = 10
step = 2
# bien doi hinh anh
print("chon huong di cua animation: ")
print("1.Left ->... | 19522515/CS231.L21-Computer-Vision-Project | Source code/pptanimation_swipe.py | pptanimation_swipe.py | py | 2,089 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "cv2.imread",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2HSV",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "cv2.split",
"line_num... |
26433388736 | import pandas as pd
import numpy as np
import json
import os
from pydub import AudioSegment
from scipy.io.wavfile import read
import stft
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import normalize
from sklearn.decomposition import PCA
import random
import signal
import cPickle as pickle
from func... | jonathanwoodard/Melospiza | source/transform_audio.py | transform_audio.py | py | 4,665 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.walk",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 66,
"usa... |
5114460856 |
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm as LogNorm
def compare_fields(delta_F, delta_DM, R_sm, pc_meta):
# from Metin 2019
'''
A function for comparing the fields of delta_F and delta_DM with hist2d.
'''
fig = plt.figure(f... | pointeee/preheat2022_public | misc_func.py | misc_func.py | py | 2,753 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.arange"... |
19686502833 | import sys
import time
from datetime import datetime
from textwrap import dedent
import requests
import telegram
from environs import Env
from loguru import logger
from telegram import ParseMode
def send_telegram_message(chat_id: int, bot: telegram.Bot, telegram_message: str) -> None:
bot.send_message(chat_id=ch... | wepeqoor1/check_success_request | check_request.py | check_request.py | py | 3,916 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "telegram.Bot",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "telegram.ParseMode.HTML",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "telegram.ParseMode",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "log... |
43535916514 | import argparse
import sys
import logging
from mutagene.profiles.profile import calc_profile
logger = logging.getLogger(__name__)
genome_error_message = """requires genome name argument -g hg19, hg38, mm10, see http://hgdownload.cse.ucsc.edu/downloads.html for more
Use mutagene fetch to down... | neksa/mutagene | mutagene/cli/profile_menu.py | profile_menu.py | py | 1,614 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.FileType",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
... |
70270071869 | from sqlalchemy import Column
from sqlalchemy import Integer, String
from sqlalchemy.orm import relationship
from app.models.base import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String, nullable=False)
email = Column(String, nullable=Fal... | cyber-chuvash/todolist-API | app/models/user.py | user.py | py | 678 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "app.models.base.Base",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Integer",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "sqlalche... |
21101364933 | import os
import tempfile
from shutil import rmtree
import pytest
import responses
from faker import Faker
from flask import Response, Flask
from flask.testing import FlaskClient
from statuspage2slack.statuspage_constants import ComponentStatus, \
IncidentStatus, IncidentImpact
fake = Faker()
STATUSPAGE_DATETIM... | Cobliteam/statuspage2slack | tests/test_webhook.py | test_webhook.py | py | 7,087 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "faker.Faker",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.realpath",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line... |
72298298427 | import pickle
from flask import Flask, request, jsonify
import numpy as np
# Load model and dv
with open("dv.pkl", "rb") as f_in:
dv = pickle.load(f_in)
with open("rf_model.pkl", "rb") as f_in:
model = pickle.load(f_in)
# instantiate
app = Flask('atx_housing_prediction')
# set path: /predict
@app.ro... | michaelfronda/ATXHousePrice | predict.py | predict.py | py | 733 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pickle.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.get_json",
"line... |
2533690932 | from typing import List, Optional
import filters as f
from iota import Address
from iota.commands import FilterCommand, RequestFilter
from iota.commands.core.find_transactions import FindTransactionsCommand
from iota.commands.core.were_addresses_spent_from import \
WereAddressesSpentFromCommand
from iota.crypto.a... | iotaledger/iota.py | iota/commands/extended/get_new_addresses.py | get_new_addresses.py | py | 3,422 | python | en | code | 344 | github-code | 6 | [
{
"api_name": "iota.commands.FilterCommand",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "iota.crypto.types.Seed",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "io... |
39749765607 | """
This file creates all the tables and databases,
used in the in_Voice APP as class,
and also does the CRUD operations of database by using the methods.
"""
# Importing the required modules to working with database
import sqlite3
# Importing os module to work with files and folders
import os
# Importing a function... | Kumara2mahe/in_Voice | inVoiceDB.py | inVoiceDB.py | py | 50,993 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 140,
"usage_type": "attribute"
},
{
"api_name": "os.mkdir",
"line_nu... |
21091581358 | import sys
import time
import yaml
from watchdog.observers import Observer
from watchdog.events import *
import ftplib
config_file = "client.yml"
def get_config(index):
with open(config_file) as f:
return yaml.load(f, Loader=yaml.FullLoader)[index]
class MyHandler(FileSystemEventHandler):
def on_modi... | yifan-ivan/FileSynchronizer | client.py | client.py | py | 1,061 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "ftplib.FTP",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "watchdog.observers.Observer... |
32726100359 | from collections import deque
from pathlib import Path
import random
from PIL import Image, ImageTk
from tkinter import Tk, Label
from typing import Callable, Optional, Sequence
from abc import ABC, abstractmethod
import numpy as np
import torch
import gym
from collections import namedtuple
from ..game.play import (P... | wecacuee/floyd-warshal-rl | fwrl/prob/gym.py | gym.py | py | 6,947 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "collections.namedtuple",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "game.play.Problem",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "gym.Env",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "gym.action_spac... |
19154810876 | from numpy import *
from time import sleep
import json
import urllib2
# 数据导入函数
def loadDataSet(fileName): # 打开一个含有分隔符的文本文件
numFeat = len(open(fileName).readline().split('\t')) - 1 # 获得特征数,减1是因为最后一列是因变量
dataMat = []
labelMat = []
fr = open(fileName)
for line in fr.readlines():
lineArr = [... | yhshu/Machine-Learning-in-Action | Ch08-LinearRegression/regression.py | regression.py | py | 9,114 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "urllib2.urlopen",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 146,
"usage_type": "call"
}
] |
10793618381 | """Code to interface with the SMA inverters and return the results."""
# Robust initialization and shutdown code courtesy of
# https://github.com/wbenny/python-graceful-shutdown.git
import logging
import sys
import os
import asyncio
import aiohttp
from delayedints import DelayedKeyboardInterrupt
from pvsite import S... | sillygoose/sbhistory | sbhistory/sbhistory.py | sbhistory.py | py | 2,975 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "asyncio.new_event_loop",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "delayedints.DelayedKeyboardInterrupt",
"line_number": 40,
"usage_type": "call"
},
{
"api... |
19626071979 | # coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String, text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from base import db_url
Base = declarative_base()
metadata = Base.metadata
db = create_engine(db_url)
ses... | natsuforyou/troubledmonkey | models.py | models.py | py | 4,401 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.create_engine",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "base.db_url",
"line_number": 12,
"usage_type": "argument"
},
{
... |
72532105789 | import json
from http import HTTPStatus
from typing import Any, Literal
import httpx
from pydantic import BaseModel, Field
from simcore_service_api_server.utils.http_calls_capture_processing import (
PathDescription,
enhance_from_openapi_spec,
)
class HttpApiCallCaptureModel(BaseModel):
"""
Captures ... | ITISFoundation/osparc-simcore | services/api-server/src/simcore_service_api_server/utils/http_calls_capture.py | http_calls_capture.py | py | 2,202 | python | en | code | 35 | github-code | 6 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Literal",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "simcore_service_api_server.utils.http_calls_capture_processing.PathDescription",
"line_number": 22,
"us... |
26530831301 | import json
from oneview_redfish_toolkit.api.composition_service import CompositionService
from oneview_redfish_toolkit.tests.base_test import BaseTest
class TestCompositionService(BaseTest):
"""Tests for CompositionService class"""
def setUp(self):
"""Tests preparation"""
# Loading Composi... | HewlettPackard/oneview-redfish-toolkit | oneview_redfish_toolkit/tests/api/test_composition_service.py | test_composition_service.py | py | 1,507 | python | en | code | 16 | github-code | 6 | [
{
"api_name": "oneview_redfish_toolkit.tests.base_test.BaseTest",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "oneview_redfish_toolkit.api.composition_service.CompositionService",
"line_number":... |
10865376818 | import logging
import json
import datetime
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.gaussian_process import GaussianProcessRegressor
from aggregating.utils import flatten_X, generate_train_set, memory_efficient_predict
from stochastic_models import MaxCallStochasticModel
### general MPI... | tlpss/ML-Project2 | mpi/utils.py | utils.py | py | 6,471 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "logging.basicConfig",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.... |
32506800793 | #!/usr/bin/env python3
"""
Read API data directly via internet and output to pipe
"""
import json
import logging
import time
import requests
from .. import defs
from . import net
from .order import ApiOrder, API_CHANNEL_SSE_NAME
from .pkt import BlocksatPkt, BlocksatPktHandler
logger = logging.getLogger(__name__)
M... | Blockstream/satellite | blocksatcli/api/demorx.py | demorx.py | py | 11,171 | python | en | code | 949 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pkt.BlocksatPkt",
"line_number": 89,
"usage_type": "argument"
},
{
"api_name": "time.time",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "pkt.pack",
"line_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.