code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import json
class TrainingSpecification:
template = """
{
"TrainingSpecification": {
"TrainingImage": "IMAGE_REPLACE_ME",
"SupportedHyperParameters": [
{
"Description": "Grow a tree with max_leaf_nodes in best-first fashion. Best nodes are defined as relative reduction in impu... | [
"json.dumps"
] | [((3938, 3964), 'json.dumps', 'json.dumps', (['list_to_return'], {}), '(list_to_return)\n', (3948, 3964), False, 'import json\n'), ((2725, 2829), 'json.dumps', 'json.dumps', (['[ob.__dict__ for ob in supported_tuning_job_objective_metrics]'], {'indent': '(4)', 'sort_keys': '(True)'}), '([ob.__dict__ for ob in supported... |
import sys
import tkinter
from .customtkinter_tk import CTk
from .customtkinter_frame import CTkFrame
from .appearance_mode_tracker import AppearanceModeTracker
from .customtkinter_color_manager import CTkColorManager
class CTkProgressBar(tkinter.Frame):
""" tkinter custom progressbar, always horizontal, values ... | [
"tkinter.Canvas"
] | [((2757, 2848), 'tkinter.Canvas', 'tkinter.Canvas', ([], {'master': 'self', 'highlightthicknes': '(0)', 'width': 'self.width', 'height': 'self.height'}), '(master=self, highlightthicknes=0, width=self.width, height=\n self.height)\n', (2771, 2848), False, 'import tkinter\n')] |
import pytest
from backtest.strategy import BuyAndHoldEqualAllocation
@pytest.fixture
def strategy():
symbols = ('AAPL', 'GOOG')
strategy = BuyAndHoldEqualAllocation(relevant_symbols=symbols)
return strategy
def test_strategy_execute(strategy):
strategy.execute()
assert len(strategy.holdings) > 0... | [
"backtest.strategy.BuyAndHoldEqualAllocation"
] | [((150, 201), 'backtest.strategy.BuyAndHoldEqualAllocation', 'BuyAndHoldEqualAllocation', ([], {'relevant_symbols': 'symbols'}), '(relevant_symbols=symbols)\n', (175, 201), False, 'from backtest.strategy import BuyAndHoldEqualAllocation\n')] |
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Constant(Base):
@staticmethod
def exp... | [
"numpy.random.randn"
] | [((364, 385), 'numpy.random.randn', 'np.random.randn', (['(5)', '(5)'], {}), '(5, 5)\n', (379, 385), True, 'import numpy as np\n')] |
"""
Date: 2021/09/23
Target: config utilities for yml file.
implementation adapted from Slimmable: https://github.com/JiahuiYu/slimmable_networks.git
"""
import os
import yaml
class LoaderMeta(type):
"""
Constructor for supporting `!include`.
"""
def __new__(mcs, __name__, __bases__, __dict__):
... | [
"os.path.exists",
"os.path.splitext",
"yaml.load",
"os.path.split"
] | [((4014, 4041), 'os.path.exists', 'os.path.exists', (['config_file'], {}), '(config_file)\n', (4028, 4041), False, 'import os\n'), ((749, 775), 'os.path.split', 'os.path.split', (['stream.name'], {}), '(stream.name)\n', (762, 775), False, 'import os\n'), ((1260, 1280), 'yaml.load', 'yaml.load', (['f', 'Loader'], {}), '... |
# -*- coding: utf-8 -*-
#
# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | [
"oslo.utils.excutils.save_and_reraise_exception",
"ironic.common.exception.DracOperationError",
"ironic.common.i18n._",
"ironic.drivers.modules.drac.common.parse_driver_info",
"ironic.drivers.modules.drac.common.get_wsman_client",
"ironic.common.exception.DracConfigJobCreationError",
"ironic.common.i18n... | [((1108, 1141), 'oslo.utils.importutils.try_import', 'importutils.try_import', (['"""pywsman"""'], {}), "('pywsman')\n", (1130, 1141), False, 'from oslo.utils import importutils\n'), ((1149, 1176), 'ironic.openstack.common.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1166, 1176), True, 'fro... |
import numpy as np
import matplotlib.pyplot as plt
#grid number on half space (without the origin)
N=150
#total grid number = 2*N + 1 (with origin)
N_g=2*N+1
#finite barrier potential value = 300 (meV)
potential_value=300
#building potential:
def potential(potential_value):
V=np.zeros((1,N_g),dtype=float)
V[0... | [
"numpy.sqrt",
"numpy.linalg.eig",
"numpy.argsort",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.show"
] | [((886, 902), 'numpy.linalg.eig', 'np.linalg.eig', (['H'], {}), '(H)\n', (899, 902), True, 'import numpy as np\n'), ((907, 929), 'numpy.argsort', 'np.argsort', (['eigenvalue'], {}), '(eigenvalue)\n', (917, 929), True, 'import numpy as np\n'), ((1004, 1031), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(1... |
import os
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
from keras.callbacks import ModelCheckpoint, EarlyStopping
import src.utils.utils as ut
import src.utils.model_utils as mu
import src.models.model as md
import src.models.data_generator as dg
import src.data.da... | [
"logging.basicConfig",
"dotenv.find_dotenv",
"keras.callbacks.ModelCheckpoint",
"pathlib.Path",
"click.option",
"src.utils.model_utils.TrainValTensorBoard",
"src.models.model.custom",
"os.path.join",
"src.utils.utils.check_modes",
"src.utils.model_utils.ref_n_classes",
"src.models.data_generator... | [((2450, 2465), 'click.command', 'click.command', ([], {}), '()\n', (2463, 2465), False, 'import click\n'), ((2467, 2676), 'click.option', 'click.option', (['"""--classmode"""'], {'type': 'str', 'default': 'ut.params.classmode', 'help': '"""choose a classmode:\n multilabel, multiclass\n ... |
# Copyright (c) 2016-2019. Mount Sinai School of Medicine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"logging.getLogger",
"Bio.Seq.reverse_complement"
] | [((1344, 1371), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1361, 1371), False, 'import logging\n'), ((12409, 12439), 'Bio.Seq.reverse_complement', 'reverse_complement', (['genome_ref'], {}), '(genome_ref)\n', (12427, 12439), False, 'from Bio.Seq import reverse_complement\n'), ((12459... |
# OS-Level Imports
import os
import sys
import multiprocessing
from multiprocessing import cpu_count
# Library Imports
import tensorflow as tf
from tensorflow.keras import mixed_precision
from tensorflow.python.distribute.distribute_lib import Strategy
# Internal Imports
from Utils.enums import Environme... | [
"tensorflow.tpu.experimental.initialize_tpu_system",
"tensorflow.distribute.OneDeviceStrategy",
"tensorflow.distribute.cluster_resolver.TPUClusterResolver",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.distribute.TPUStrategy",
"tensorflow.config.list_logical_devices",
"multiprocessing... | [((471, 498), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (496, 498), False, 'import multiprocessing\n'), ((5486, 5524), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (5517, 5524), True, 'import tensorflow as tf\n'), ((698... |
from turbo.flux import Mutation, register, dispatch, register_dispatch
import mutation_types
@register_dispatch('user', mutation_types.INCREASE)
def increase(rank):
pass
def decrease(rank):
return dispatch('user', mutation_types.DECREASE, rank)
| [
"turbo.flux.register_dispatch",
"turbo.flux.dispatch"
] | [((97, 147), 'turbo.flux.register_dispatch', 'register_dispatch', (['"""user"""', 'mutation_types.INCREASE'], {}), "('user', mutation_types.INCREASE)\n", (114, 147), False, 'from turbo.flux import Mutation, register, dispatch, register_dispatch\n'), ((210, 257), 'turbo.flux.dispatch', 'dispatch', (['"""user"""', 'mutat... |
import logging
import os
import io
from fastapi import APIRouter, Depends, Header
from fastapi.responses import FileResponse, StreamingResponse
from fastapi import HTTPException, status
import pyarrow as pa
import pyarrow.parquet as pq
from data_service.api.query_models import (
InputTimePeriodQuery, InputTimeQue... | [
"logging.getLogger",
"fastapi.Header",
"pyarrow.BufferOutputStream",
"fastapi.HTTPException",
"fastapi.responses.FileResponse",
"data_service.api.auth.authorize_user",
"os.path.isfile",
"fastapi.APIRouter",
"pyarrow.parquet.write_table",
"fastapi.Depends"
] | [((664, 675), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (673, 675), False, 'from fastapi import APIRouter, Depends, Header\n'), ((682, 709), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (699, 709), False, 'import logging\n'), ((902, 914), 'fastapi.Header', 'Header', (['None'],... |
import json
import argparse
from argus.callbacks import MonitorCheckpoint, \
EarlyStopping, LoggingToFile, ReduceLROnPlateau
from torch.utils.data import DataLoader
from src.datasets import FreesoundDataset, FreesoundNoisyDataset, RandomDataset
from src.datasets import get_corrected_noisy_data, FreesoundCorrecte... | [
"src.transforms.get_transforms",
"src.mixers.SigmoidConcatMixer",
"src.mixers.AddMixer",
"argus.callbacks.EarlyStopping",
"src.datasets.get_corrected_noisy_data",
"argparse.ArgumentParser",
"src.utils.load_noisy_data",
"argus.callbacks.ReduceLROnPlateau",
"argus.callbacks.MonitorCheckpoint",
"src.... | [((592, 617), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (615, 617), False, 'import argparse\n'), ((1727, 1957), 'src.transforms.get_transforms', 'get_transforms', ([], {'train': '(True)', 'size': 'CROP_SIZE', 'wrap_pad_prob': 'WRAP_PAD_PROB', 'resize_scale': '(0.8, 1.0)', 'resize_ratio': '... |
import pytest
@pytest.fixture(scope="session")
def test_data():
from pathlib import Path
module_dir = Path(__file__).resolve().parent
test_dir = module_dir / "test_data"
return test_dir.resolve()
@pytest.fixture(scope="session")
def database():
return "jobflow_test"
@pytest.fixture(scope="ses... | [
"pathlib.Path",
"fireworks.LaunchPad",
"os.getcwd",
"os.chdir",
"tempfile.mkdtemp",
"maggma.stores.MemoryStore",
"shutil.rmtree",
"pytest.fixture",
"maggma.stores.MongoStore"
] | [((17, 48), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (31, 48), False, 'import pytest\n'), ((218, 249), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (232, 249), False, 'import pytest\n'), ((295, 326), 'pytest.fixture', 'p... |
# This script allows to download a single file from a remote ZIP archive
# without downloading the whole ZIP file itself.
# The hosting server needs to support the HTTP range header for it to work
import zipfile
import requests
import argparse
class HTTPIO(object):
def __init__(self, url):
self.url = url... | [
"requests.head",
"argparse.ArgumentParser"
] | [((1672, 1697), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1695, 1697), False, 'import argparse\n'), ((333, 356), 'requests.head', 'requests.head', (['self.url'], {}), '(self.url)\n', (346, 356), False, 'import requests\n')] |
""" Example 035: Scheduled sending and delayed routing """
from os import path
from docusign_esign.client.api_exception import ApiException
from flask import render_template, session, Blueprint, request
from ..examples.eg035_scheduled_sending import Eg035ScheduledSendingController
from ...docusign import authentica... | [
"flask.render_template",
"flask.Blueprint",
"flask.request.form.get"
] | [((494, 522), 'flask.Blueprint', 'Blueprint', (['"""eg035"""', '__name__'], {}), "('eg035', __name__)\n", (503, 522), False, 'from flask import render_template, session, Blueprint, request\n'), ((842, 873), 'flask.request.form.get', 'request.form.get', (['"""resume_date"""'], {}), "('resume_date')\n", (858, 873), False... |
## Unit 4 Project - Two Player Game
## <NAME> - Computer Programming II
## The Elder Scrolls X
# A fan made 2 player game successor the The Elder Scrolls Series
# Two players start off in an arena
# Can choose starting items
# Can choose classes
## Libraries
import time # Self explanatory
import random # ... | [
"os.system",
"platform.system",
"time.sleep"
] | [((501, 516), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (511, 516), False, 'import time\n'), ((1911, 1946), 'os.system', 'os.system', (['"""figlet Elder Scrolls X"""'], {}), "('figlet Elder Scrolls X')\n", (1920, 1946), False, 'import os, platform\n'), ((2087, 2104), 'platform.system', 'platform.system', ... |
#!/usr/bin/env python3
# ===================================================================================
# Copyright (C) 2019 Fraunhofer Gesellschaft. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by Fraunhofer G... | [
"json.loads",
"requests.post"
] | [((1846, 1903), 'requests.post', 'requests.post', (['advanced_api'], {'files': 'files', 'headers': 'headers'}), '(advanced_api, files=files, headers=headers)\n', (1859, 1903), False, 'import requests\n'), ((1964, 1989), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (1974, 1989), False, 'impo... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 20 08:40:22 2017
@author: fabio
"""
import ee
import ee.mapclient
ee.Initialize()
collection = ee.ImageCollection('MODIS/MCD43A4_NDVI')
lista = collection.toList(10)
#print lista.getInfo()
image = ee.Image('LC8_L1T/LC81910312016217LGN00')
#prin... | [
"ee.mapclient.addToMap",
"ee.Image",
"ee.ImageCollection",
"ee.Initialize",
"ee.mapclient.centerMap"
] | [((139, 154), 'ee.Initialize', 'ee.Initialize', ([], {}), '()\n', (152, 154), False, 'import ee\n'), ((169, 209), 'ee.ImageCollection', 'ee.ImageCollection', (['"""MODIS/MCD43A4_NDVI"""'], {}), "('MODIS/MCD43A4_NDVI')\n", (187, 209), False, 'import ee\n'), ((273, 314), 'ee.Image', 'ee.Image', (['"""LC8_L1T/LC8191031201... |
from django.contrib import admin
from .models import Contato, Venda, FormaPagamento
admin.site.register(Contato)
admin.site.register(Venda)
admin.site.register(FormaPagamento)
| [
"django.contrib.admin.site.register"
] | [((85, 113), 'django.contrib.admin.site.register', 'admin.site.register', (['Contato'], {}), '(Contato)\n', (104, 113), False, 'from django.contrib import admin\n'), ((114, 140), 'django.contrib.admin.site.register', 'admin.site.register', (['Venda'], {}), '(Venda)\n', (133, 140), False, 'from django.contrib import adm... |
from __future__ import unicode_literals
from __future__ import print_function
import moya
from moya.compat import text_type
from requests_oauthlib import OAuth1Session
def get_credentials(provider, credentials):
client_id = credentials.client_id or provider.get('client_id', None)
client_secret = credentials... | [
"requests_oauthlib.OAuth1Session",
"moya.compat.text_type",
"moya.expose.macro"
] | [((413, 458), 'moya.expose.macro', 'moya.expose.macro', (['"""get_oauth_resource_owner"""'], {}), "('get_oauth_resource_owner')\n", (430, 458), False, 'import moya\n'), ((1003, 1047), 'moya.expose.macro', 'moya.expose.macro', (['"""get_oauth_authorize_url"""'], {}), "('get_oauth_authorize_url')\n", (1020, 1047), False,... |
"""
Cartesian genetic programming
"""
import operator as op
import random
import copy
import math
from settings import VERBOSE, N_COLS, LEVEL_BACK
class Function:
"""
A general function
"""
def __init__(self, f, arity, name=None):
self.f = f
self.arity = arity
self.name = f.... | [
"random.random",
"random.uniform",
"random.choice",
"copy.deepcopy"
] | [((3494, 3513), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (3507, 3513), False, 'import copy\n'), ((6349, 6371), 'random.choice', 'random.choice', (['parents'], {}), '(parents)\n', (6362, 6371), False, 'import random\n'), ((1672, 1730), 'random.uniform', 'random.uniform', (['self.weight_range[0]', 's... |
import torch as t
import torch_geometric.utils as utils
def qw_score(graph):
"""
未实现qw_score,采用度数代替
:param graph:
"""
score = utils.degree(graph.edge_index[0])
return score.sort()
def pre_processing(graph, m, score, trees):
score, indices = score
indices.squeeze_()
old_edges = gr... | [
"torch_geometric.utils.degree",
"torch.nonzero",
"torch.tensor",
"torch_geometric.utils.k_hop_subgraph",
"torch.zeros",
"torch.cat"
] | [((148, 181), 'torch_geometric.utils.degree', 'utils.degree', (['graph.edge_index[0]'], {}), '(graph.edge_index[0])\n', (160, 181), True, 'import torch_geometric.utils as utils\n'), ((2664, 2697), 'torch_geometric.utils.degree', 'utils.degree', (['graph.edge_index[0]'], {}), '(graph.edge_index[0])\n', (2676, 2697), Tru... |
#/*
# * Copyright (C) 2017 - This file is part of libecc project
# *
# * Authors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * Contributors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * This software is licensed under a dual BSD and GPL v2 license.
# * See LI... | [
"struct.pack"
] | [((2141, 2168), 'struct.pack', 'struct.pack', (['"""<Q"""', 'state[i]'], {}), "('<Q', state[i])\n", (2152, 2168), False, 'import struct\n')] |
import torch
import torch.nn as nn
import optflow.compute_tvl1_energy as compute_tvl1_energy
def EPE(input_flow, target_flow, sparse=False, mean=True):
EPE_map = torch.norm(target_flow-input_flow,2,1)
if sparse:
EPE_map = EPE_map[target_flow != 0]
if mean:
return EPE_map.mean()
else:
... | [
"torch.nn.functional.upsample",
"torch.norm",
"torch.nn.functional.adaptive_avg_pool2d",
"optflow.compute_tvl1_energy.compute_tvl1_energy_optimized_batch"
] | [((167, 209), 'torch.norm', 'torch.norm', (['(target_flow - input_flow)', '(2)', '(1)'], {}), '(target_flow - input_flow, 2, 1)\n', (177, 209), False, 'import torch\n'), ((1656, 1716), 'torch.nn.functional.upsample', 'nn.functional.upsample', (['output'], {'size': '(h, w)', 'mode': '"""bilinear"""'}), "(output, size=(h... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
"django.utils.module_loading.import_string"
] | [((1310, 1356), 'django.utils.module_loading.import_string', 'import_string', (['"""pipeline.engine.core.data.api"""'], {}), "('pipeline.engine.core.data.api')\n", (1323, 1356), False, 'from django.utils.module_loading import import_string\n')] |
import numpy as np
def _check_mne(name):
"""Helper to check if h5py is installed"""
try:
import mne
except ImportError:
raise ImportError('Please install MNE-python to use %s.' % name)
return mne
def raw_to_mask(raw, ixs, events=None, tmin=None, tmax=None):
"""
A function to ... | [
"numpy.array",
"numpy.empty",
"numpy.unique",
"numpy.atleast_1d"
] | [((3066, 3084), 'numpy.atleast_1d', 'np.atleast_1d', (['ixs'], {}), '(ixs)\n', (3079, 3084), True, 'import numpy as np\n'), ((3978, 4002), 'numpy.atleast_1d', 'np.atleast_1d', (['self.tmin'], {}), '(self.tmin)\n', (3991, 4002), True, 'import numpy as np\n'), ((4023, 4047), 'numpy.atleast_1d', 'np.atleast_1d', (['self.t... |
import random
async def magicEightBall(ctx, message=True):
if message:
eightBall = random.randint(0, 19)
outlooks = [
"As I see it, yes.",
"Ask again later.",
"Better not tell you now.",
"Cannot predict now.",
"Concentrate and ask again."... | [
"random.randint"
] | [((97, 118), 'random.randint', 'random.randint', (['(0)', '(19)'], {}), '(0, 19)\n', (111, 118), False, 'import random\n')] |
import time
import board
import busio
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import neopixel
# Import Philips Hue Bridge
from adafruit_hue import Bridge
# Get wifi details and more from a secrets.py file
... | [
"adafruit_esp32spi.adafruit_esp32spi.ESP_SPIcontrol",
"adafruit_hue.Bridge",
"busio.SPI",
"time.sleep",
"adafruit_esp32spi.adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager",
"neopixel.NeoPixel",
"digitalio.DigitalInOut"
] | [((499, 525), 'digitalio.DigitalInOut', 'DigitalInOut', (['board.ESP_CS'], {}), '(board.ESP_CS)\n', (511, 525), False, 'from digitalio import DigitalInOut\n'), ((541, 569), 'digitalio.DigitalInOut', 'DigitalInOut', (['board.ESP_BUSY'], {}), '(board.ESP_BUSY)\n', (553, 569), False, 'from digitalio import DigitalInOut\n'... |
#
# Copyright (c) 2013-2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | [
"kore.socket_wrap",
"kore.fatal",
"socket.socket"
] | [((920, 969), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (933, 969), False, 'import socket\n'), ((1084, 1106), 'kore.socket_wrap', 'kore.socket_wrap', (['sock'], {}), '(sock)\n', (1100, 1106), False, 'import kore\n'), ((1505, 1535), 'kore.... |
import asyncio
import logging
import traceback
import uuid
from typing import Optional, Tuple, Any, Callable
from pesto.ws.core.payload_parser import PayloadParser, PestoConfig
from pesto.ws.core.pesto_feature import PestoFeatures
from pesto.ws.core.utils import load_class, async_exec
from pesto.ws.features.algorithm_... | [
"logging.getLogger",
"pesto.ws.core.utils.load_class",
"pesto.ws.service.describe.DescribeService",
"pesto.ws.features.payload_debug.PayloadDebug",
"uuid.uuid4",
"pesto.ws.features.payload_converter.PayloadConverter",
"pesto.ws.features.converter.image.image_roi.DummyImageROI",
"pesto.ws.core.payload_... | [((932, 959), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (949, 959), False, 'import logging\n'), ((2215, 2243), 'pesto.ws.core.payload_parser.PayloadParser.parse', 'PayloadParser.parse', (['payload'], {}), '(payload)\n', (2234, 2243), False, 'from pesto.ws.core.payload_parser import P... |
# -*- coding: utf-8 -*-
import logging
import os
import re
import sys
class Helpers:
def __init__(self, logger=None):
if logger is None:
self.logger = logging.getLogger(__name__)
else:
self.logger = logger
@staticmethod
def extract_sequence_num(filename):
s... | [
"logging.getLogger",
"os.listdir",
"os.path.join",
"os.path.basename",
"sys.exit"
] | [((843, 868), 'os.listdir', 'os.listdir', (['sql_directory'], {}), '(sql_directory)\n', (853, 868), False, 'import os\n'), ((177, 204), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (194, 204), False, 'import logging\n'), ((736, 747), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (744,... |
import configparser
import os
import typing
from sitri.providers.base import ConfigProvider
class IniConfigProvider(ConfigProvider):
"""Config provider for Initialization file (Ini)."""
provider_code = "ini"
def __init__(
self,
ini_path: str = "./config.ini",
):
"""
... | [
"os.path.abspath",
"configparser.ConfigParser"
] | [((395, 422), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (420, 422), False, 'import configparser\n'), ((442, 467), 'os.path.abspath', 'os.path.abspath', (['ini_path'], {}), '(ini_path)\n', (457, 467), False, 'import os\n')] |
# -*- coding: utf-8 -*-
"""
"""
import scrapy
from tennis_model.tennis_model_scraper.tennis_model_scraper import items
class TennisDataCoUkSpider(scrapy.Spider):
name = "tennis_data_co_uk"
allowed_domains = ["www.tennis-data.co.uk"]
start_urls = ["http://www.tennis-data.co.uk/alldata.php"]
custom_... | [
"tennis_model.tennis_model_scraper.tennis_model_scraper.items.TennisDataCoUkItem"
] | [((1093, 1119), 'tennis_model.tennis_model_scraper.tennis_model_scraper.items.TennisDataCoUkItem', 'items.TennisDataCoUkItem', ([], {}), '()\n', (1117, 1119), False, 'from tennis_model.tennis_model_scraper.tennis_model_scraper import items\n')] |
import json
import requests
from .exceptions import (
RequestsError,
RequestsTimeoutError,
RPCError
)
_default_endpoint = 'http://localhost:9500'
_default_timeout = 30
def base_request(method, params=None, endpoint=_default_endpoint, timeout=_default_timeout) -> str:
"""
Basic RPC request
... | [
"json.loads",
"json.dumps"
] | [((2470, 2490), 'json.loads', 'json.loads', (['raw_resp'], {}), '(raw_resp)\n', (2480, 2490), False, 'import json\n'), ((1302, 1321), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (1312, 1321), False, 'import json\n')] |
import sys
import numpy
import numpy as np
from snappy import Product
from snappy import ProductData
from snappy import ProductIO
from snappy import ProductUtils
from snappy import FlagCoding
##############
import csv
###############MSVR
from sklearn.svm import SVR
from sklearn.preprocessing import StandardScaler
fro... | [
"snappy.ProductIO.readProduct",
"snappy.ProductUtils.copyGeoCoding",
"snappy.Product",
"snappy.ProductIO.getProductWriter",
"numpy.asarray",
"numpy.column_stack",
"snappy.FlagCoding",
"sklearn.preprocessing.StandardScaler",
"numpy.zeros",
"numpy.array",
"snappy.ProductUtils.copyMetadata",
"csv... | [((520, 547), 'snappy.ProductIO.readProduct', 'ProductIO.readProduct', (['file'], {}), '(file)\n', (541, 547), False, 'from snappy import ProductIO\n'), ((1284, 1318), 'numpy.asarray', 'np.asarray', (['data'], {'dtype': 'np.float32'}), '(data, dtype=np.float32)\n', (1294, 1318), True, 'import numpy as np\n'), ((1389, 1... |
from __future__ import print_function
import argparse, sys
from .utils import is_textfile
def contains_crlf(filename):
with open(filename, mode='rb') as file_checked:
for line in file_checked.readlines():
if line.endswith(b'\r\n'):
return True
return False
def main(argv=Non... | [
"argparse.ArgumentParser"
] | [((337, 362), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (360, 362), False, 'import argparse, sys\n')] |
from dataclasses import dataclass
from typing import List
from typing import Union
from postmanparser.description import Description
from postmanparser.exceptions import InvalidObjectException
from postmanparser.exceptions import MissingRequiredFieldException
@dataclass
class FormParameter:
key: str
value: s... | [
"postmanparser.exceptions.MissingRequiredFieldException",
"postmanparser.exceptions.InvalidObjectException",
"postmanparser.description.Description.parse"
] | [((669, 756), 'postmanparser.exceptions.MissingRequiredFieldException', 'MissingRequiredFieldException', (['"""\'formparameter\' object should have \'key\' property"""'], {}), '(\n "\'formparameter\' object should have \'key\' property")\n', (698, 756), False, 'from postmanparser.exceptions import MissingRequiredFie... |
from __future__ import absolute_import, division, print_function
import numpy as np
import wx
from dials.array_family import flex
from dials_viewer_ext import rgb_img
class wxbmp_from_np_array(object):
def __init__(
self, lst_data_in, show_nums=True, palette="black2white", lst_data_mask_in=None
):
... | [
"numpy.amax",
"numpy.amin",
"dials_viewer_ext.rgb_img",
"wx.MemoryDC",
"numpy.size",
"wx.Image",
"numpy.zeros",
"numpy.empty",
"dials.array_family.flex.double"
] | [((345, 354), 'dials_viewer_ext.rgb_img', 'rgb_img', ([], {}), '()\n', (352, 354), False, 'from dials_viewer_ext import rgb_img\n'), ((3055, 3087), 'numpy.zeros', 'np.zeros', (['(ymax, xmax)', '"""double"""'], {}), "((ymax, xmax), 'double')\n", (3063, 3087), True, 'import numpy as np\n'), ((3114, 3146), 'numpy.zeros', ... |
import numpy as np
def check_x_y(x, y):
assert isinstance(x, np.ndarray) and isinstance(y, np.ndarray)
assert np.ndim(x) <= 3 and np.ndim(y) <= 2
assert len(x) == len(y)
| [
"numpy.ndim"
] | [((125, 135), 'numpy.ndim', 'np.ndim', (['x'], {}), '(x)\n', (132, 135), True, 'import numpy as np\n'), ((145, 155), 'numpy.ndim', 'np.ndim', (['y'], {}), '(y)\n', (152, 155), True, 'import numpy as np\n')] |
"""
CSharp (С#) domain for sphinx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sphinxsharp Pro (with custom styling)
:copyright: Copyright 2021 by MadTeddy
"""
import re
import warnings
from os import path
from collections import defaultdict, namedtuple
from docutils import nodes
from docutils.parsers.rst import... | [
"sphinx.addnodes.desc_name",
"os.path.exists",
"sphinx.addnodes.index",
"collections.namedtuple",
"sphinx.addnodes.desc_type",
"re.compile",
"os.path.join",
"sphinx.addnodes.desc_content",
"os.path.dirname",
"sphinx.addnodes.pending_xref",
"sphinx.addnodes.desc",
"collections.defaultdict",
"... | [((1293, 1400), 're.compile', 're.compile', (["('^((?:(?:' + MODIFIERS_RE +\n ')\\\\s+)*)?(\\\\w+)\\\\s([\\\\w\\\\.]+)(?:<(.+)>)?(?:\\\\s?\\\\:\\\\s?(.+))?$')"], {}), "('^((?:(?:' + MODIFIERS_RE +\n ')\\\\s+)*)?(\\\\w+)\\\\s([\\\\w\\\\.]+)(?:<(.+)>)?(?:\\\\s?\\\\:\\\\s?(.+))?$')\n", (1303, 1400), False, 'import r... |
from KratosMultiphysics import ParallelEnvironment, IsDistributedRun
if IsDistributedRun():
from KratosMultiphysics.mpi import DataCommunicatorFactory
import KratosMultiphysics.KratosUnittest as UnitTest
import math
class TestDataCommunicatorFactory(UnitTest.TestCase):
def setUp(self):
self.registere... | [
"KratosMultiphysics.ParallelEnvironment.GetDefaultDataCommunicator",
"KratosMultiphysics.mpi.DataCommunicatorFactory.CreateUnionAndRegister",
"math.ceil",
"KratosMultiphysics.mpi.DataCommunicatorFactory.SplitAndRegister",
"math.floor",
"KratosMultiphysics.KratosUnittest.main",
"KratosMultiphysics.mpi.Da... | [((72, 90), 'KratosMultiphysics.IsDistributedRun', 'IsDistributedRun', ([], {}), '()\n', (88, 90), False, 'from KratosMultiphysics import ParallelEnvironment, IsDistributedRun\n'), ((5606, 5621), 'KratosMultiphysics.KratosUnittest.main', 'UnitTest.main', ([], {}), '()\n', (5619, 5621), True, 'import KratosMultiphysics.... |
from __future__ import print_function
try:
import vkaudiotoken
except ImportError:
import path_hack
from vkaudiotoken import supported_clients
import sys
import requests
import json
token = sys.argv[1]
user_agent = supported_clients.KATE.user_agent
sess = requests.session()
sess.headers.update({'User-Agent'... | [
"requests.session"
] | [((268, 286), 'requests.session', 'requests.session', ([], {}), '()\n', (284, 286), False, 'import requests\n')] |
# -*- coding: utf-8 -*-
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
exchange = ccxt.binance({
'apiKey': '<KEY>',
'secret': '<KEY>',
'enableRateLimit': True... | [
"os.path.abspath",
"ccxt.binance",
"sys.path.append",
"pprint.pprint"
] | [((156, 189), 'sys.path.append', 'sys.path.append', (["(root + '/python')"], {}), "(root + '/python')\n", (171, 189), False, 'import sys\n'), ((230, 307), 'ccxt.binance', 'ccxt.binance', (["{'apiKey': '<KEY>', 'secret': '<KEY>', 'enableRateLimit': True}"], {}), "({'apiKey': '<KEY>', 'secret': '<KEY>', 'enableRateLimit'... |
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import itertools
import os
import re
from . import base
class OutProc(base.ExpectedOutProc):
def __init__(self, expected_outcomes, basepath, expected_... | [
"os.path.exists",
"itertools.izip_longest",
"re.match",
"os.path.basename"
] | [((1542, 1608), 'itertools.izip_longest', 'itertools.izip_longest', (['expected_lines', 'actual_lines'], {'fillvalue': '""""""'}), "(expected_lines, actual_lines, fillvalue='')\n", (1564, 1608), False, 'import itertools\n'), ((1377, 1402), 'os.path.exists', 'os.path.exists', (['base_path'], {}), '(base_path)\n', (1391,... |
import pytest
from Thycotic import Client, \
secret_password_get_command, secret_username_get_command, \
secret_get_command, secret_password_update_command, secret_checkout_command, secret_checkin_command, \
secret_delete_command, folder_create_command, folder_delete_command, folder_update_command
from tes... | [
"pytest.mark.parametrize",
"Thycotic.Client"
] | [((1483, 2660), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""command, args, http_response, context"""', '[(secret_password_get_command, GET_PASSWORD_BY_ID_ARGS,\n GET_PASSWORD_BY_ID_RAW_RESPONSE, GET_PASSWORD_BY_ID_CONTEXT), (\n secret_username_get_command, GET_USERNAME_BY_ID_ARGS,\n GET_USERNAM... |
import os
import glob
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path):
xml_list = []
for xml_file in glob.glob(path + '/*.xml'):
tree = ET.parse(xml_file)
root = tree.getroot()
for member in root.findall('object'):
value = (root.find('filename').... | [
"pandas.DataFrame",
"xml.etree.ElementTree.parse",
"glob.glob",
"os.getcwd"
] | [((139, 165), 'glob.glob', 'glob.glob', (["(path + '/*.xml')"], {}), "(path + '/*.xml')\n", (148, 165), False, 'import glob\n'), ((692, 735), 'pandas.DataFrame', 'pd.DataFrame', (['xml_list'], {'columns': 'column_name'}), '(xml_list, columns=column_name)\n', (704, 735), True, 'import pandas as pd\n'), ((182, 200), 'xml... |
import sys, os, json, jinja2, redis
from jinja2 import Template
r_server = redis.StrictRedis('127.0.0.1', db=2)
i_key = "owner-info"
json_data = r_server.get(i_key)
if json_data is not None:
data = json.loads(json_data)
main_domain = data['Hostname']
fqdn = sys.argv[1] + ".ext." + main_domain
config_template... | [
"json.loads",
"redis.StrictRedis",
"jinja2.Template"
] | [((76, 112), 'redis.StrictRedis', 'redis.StrictRedis', (['"""127.0.0.1"""'], {'db': '(2)'}), "('127.0.0.1', db=2)\n", (93, 112), False, 'import sys, os, json, jinja2, redis\n'), ((393, 418), 'jinja2.Template', 'Template', (['config_template'], {}), '(config_template)\n', (401, 418), False, 'from jinja2 import Template\... |
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['test_keywords 1'] = '[{"lineno": 7, "source": [" a\\n"], "value": "1"}, {"lineno": 7, "source": [" a\\n"], "value": "2"}, {"lineno": 7,... | [
"snapshottest.Snapshot"
] | [((156, 166), 'snapshottest.Snapshot', 'Snapshot', ([], {}), '()\n', (164, 166), False, 'from snapshottest import Snapshot\n')] |
import numpy as np
from radix import radixConvert
c = radixConvert()
a = np.load("../../data/5/layer4.npy")
print(a.shape)
a = a*128
a = np.around(a).astype(np.int16)
print(a)
a = np.load('../../data/6.npy')
a = a*128
a = np.around(a).astype(np.int8)
print(a.shape)
for i in range(84):
print(i)
print(a[i])
''... | [
"numpy.load",
"numpy.around",
"radix.radixConvert"
] | [((54, 68), 'radix.radixConvert', 'radixConvert', ([], {}), '()\n', (66, 68), False, 'from radix import radixConvert\n'), ((74, 108), 'numpy.load', 'np.load', (['"""../../data/5/layer4.npy"""'], {}), "('../../data/5/layer4.npy')\n", (81, 108), True, 'import numpy as np\n'), ((183, 210), 'numpy.load', 'np.load', (['""".... |
from saifooler.classifiers.classifier import Classifier
import torch
import json
import os
class ImageNetClassifier(Classifier):
def __init__(self, model, *args, **kwargs):
super().__init__(model, *args, **kwargs)
self.std = torch.tensor([0.229, 0.224, 0.225], device=self.device)
self.mea... | [
"os.path.dirname",
"torch.tensor"
] | [((248, 303), 'torch.tensor', 'torch.tensor', (['[0.229, 0.224, 0.225]'], {'device': 'self.device'}), '([0.229, 0.224, 0.225], device=self.device)\n', (260, 303), False, 'import torch\n'), ((324, 379), 'torch.tensor', 'torch.tensor', (['[0.485, 0.456, 0.406]'], {'device': 'self.device'}), '([0.485, 0.456, 0.406], devic... |
#!/usr/bin/env python
# coding: utf-8
# conda install pytorch>=1.6 cudatoolkit=10.2 -c pytorch
# wandb login XXX
import json
import logging
import os
import re
import sklearn
import time
from itertools import product
import numpy as np
import pandas as pd
import wandb
#from IPython import get_ipython
from keras.prepro... | [
"os.path.exists",
"wandb.log",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"itertools.product",
"os.environ.get",
"numpy.argmax",
"numpy.sum",
"pandas.concat",
"os.getpid",
"re.sub",
"logging.info"
] | [((827, 866), 'os.environ.get', 'os.environ.get', (['"""TAG"""', '"""bertsification"""'], {}), "('TAG', 'bertsification')\n", (841, 866), False, 'import os\n'), ((976, 1004), 'os.environ.get', 'os.environ.get', (['"""MODELNAMES"""'], {}), "('MODELNAMES')\n", (990, 1004), False, 'import os\n'), ((3792, 3865), 'sklearn.m... |
if not __name__ == "__main__":
print("Started <Pycraft_StartupAnimation>")
class GenerateStartupScreen:
def __init__(self):
pass
def Start(self):
try:
self.Display.fill(self.BackgroundCol)
self.mod_Pygame__... | [
"tkinter.messagebox.showerror",
"tkinter.Tk"
] | [((7525, 7532), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (7530, 7532), True, 'import tkinter as tk\n'), ((7559, 7673), 'tkinter.messagebox.showerror', 'messagebox.showerror', (['"""Startup Fail"""', '"""You need to run this as part of Pycraft, please run the \'main.py\' file"""'], {}), '(\'Startup Fail\',\n "You nee... |
#!/usr/bin/env python3
"""Script to do basic health checks of the system and turn on an LED on
BCM pin 12 (pin 32 on header) if they pass, turn Off otherwise.
"""
import time
import RPi.GPIO as GPIO
import subprocess
# The BCM pin number that the LED is wired to. When the pin
# is at 3.3V the LED is On.
LED_PIN = 12... | [
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings",
"time.sleep",
"subprocess.call",
"RPi.GPIO.setmode"
] | [((322, 344), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (334, 344), True, 'import RPi.GPIO as GPIO\n'), ((345, 368), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (361, 368), True, 'import RPi.GPIO as GPIO\n'), ((369, 398), 'RPi.GPIO.setup', 'GPIO.setup', (['L... |
import json
import numpy as np
from tqdm import tqdm
# Change these based on experiment
#exp_dataset = 'mask_char_oov_test_set.db'
#exp_name = 'results_test_mask_char'
#exp_dataset = 'mask_2_oov_test_set.db'
#exp_name = 'results_test_mask_2'
#exp_dataset = 'mask_2_oov_test_set.db'
#exp_name = 'results_test_synonyms_ma... | [
"tqdm.tqdm"
] | [((1923, 1935), 'tqdm.tqdm', 'tqdm', (['q_list'], {}), '(q_list)\n', (1927, 1935), False, 'from tqdm import tqdm\n')] |
import bts.model as model
import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
BATCH_SIZE = 6
FILTER_LIST = [16,32,64,128,256]
unet_model = model.DynamicUNet(FILTER_LIST)
unet_model.summary(batch_size=BATCH_SIZE, device=device)
| [
"bts.model.DynamicUNet",
"torch.cuda.is_available"
] | [((171, 201), 'bts.model.DynamicUNet', 'model.DynamicUNet', (['FILTER_LIST'], {}), '(FILTER_LIST)\n', (188, 201), True, 'import bts.model as model\n'), ((72, 97), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (95, 97), False, 'import torch\n')] |
# -*- coding: utf-8 -*-
import sphinx_rtd_theme
# -- General configuration -----------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_te... | [
"sphinx_rtd_theme.get_html_theme_path"
] | [((767, 805), 'sphinx_rtd_theme.get_html_theme_path', 'sphinx_rtd_theme.get_html_theme_path', ([], {}), '()\n', (803, 805), False, 'import sphinx_rtd_theme\n')] |
import importlib
import os
import pytest
from helpers import running_on_ci
import janitor.biology # noqa: F403, F401
# Skip all tests if Biopython not installed
pytestmark = pytest.mark.skipif(
(importlib.util.find_spec("Bio") is None) & ~running_on_ci(),
reason="Biology tests relying on Biopython only requ... | [
"importlib.util.find_spec",
"helpers.running_on_ci",
"os.path.join"
] | [((203, 234), 'importlib.util.find_spec', 'importlib.util.find_spec', (['"""Bio"""'], {}), "('Bio')\n", (227, 234), False, 'import importlib\n'), ((247, 262), 'helpers.running_on_ci', 'running_on_ci', ([], {}), '()\n', (260, 262), False, 'from helpers import running_on_ci\n'), ((502, 555), 'os.path.join', 'os.path.join... |
"""TilePyramid creation."""
import pytest
from shapely.geometry import Point
from shapely.ops import unary_union
from types import GeneratorType
from tilematrix import TilePyramid, snap_bounds
def test_init():
"""Initialize TilePyramids."""
for tptype in ["geodetic", "mercator"]:
assert TilePyramid(... | [
"shapely.geometry.Point",
"tilematrix.TilePyramid",
"tilematrix.snap_bounds",
"pytest.raises"
] | [((1042, 1065), 'tilematrix.TilePyramid', 'TilePyramid', (['"""geodetic"""'], {}), "('geodetic')\n", (1053, 1065), False, 'from tilematrix import TilePyramid, snap_bounds\n'), ((1290, 1313), 'tilematrix.TilePyramid', 'TilePyramid', (['"""geodetic"""'], {}), "('geodetic')\n", (1301, 1313), False, 'from tilematrix import... |
# -*- coding: utf-8 -*-
"""
setup.py script
"""
import io
from collections import OrderedDict
from setuptools import setup, find_packages
with io.open('README.md', 'rt', encoding='utf8') as f:
README = f.read()
setup(
name='reportbuilder',
version='0.0.1',
url='http://github.com/giovannicuriel/report... | [
"collections.OrderedDict",
"io.open"
] | [((145, 188), 'io.open', 'io.open', (['"""README.md"""', '"""rt"""'], {'encoding': '"""utf8"""'}), "('README.md', 'rt', encoding='utf8')\n", (152, 188), False, 'import io\n'), ((348, 518), 'collections.OrderedDict', 'OrderedDict', (["(('Code', 'https://github.com/giovannicuriel/report-builder.git'), (\n 'Issue track... |
from django.urls import path
from itembase.core.views.location_views import LocationAddressCreateView, LocationAddressDetailView, \
LocationAddressUpdateView, LocationCreateView, LocationDeleteView, LocationDetailView, LocationListView, \
LocationUpdateView
app_name = "locations"
urlpatterns = [
path("", ... | [
"itembase.core.views.location_views.LocationAddressUpdateView.as_view",
"itembase.core.views.location_views.LocationDeleteView.as_view",
"itembase.core.views.location_views.LocationListView.as_view",
"itembase.core.views.location_views.LocationAddressDetailView.as_view",
"itembase.core.views.location_views.... | [((320, 346), 'itembase.core.views.location_views.LocationListView.as_view', 'LocationListView.as_view', ([], {}), '()\n', (344, 346), False, 'from itembase.core.views.location_views import LocationAddressCreateView, LocationAddressDetailView, LocationAddressUpdateView, LocationCreateView, LocationDeleteView, LocationD... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | [
"openerp.osv.fields.selection",
"time.strftime",
"openerp.osv.fields.date",
"openerp.tools.translate._"
] | [((1209, 1228), 'openerp.osv.fields.date', 'fields.date', (['"""From"""'], {}), "('From')\n", (1220, 1228), False, 'from openerp.osv import fields, osv\n'), ((1249, 1266), 'openerp.osv.fields.date', 'fields.date', (['"""To"""'], {}), "('To')\n", (1260, 1266), False, 'from openerp.osv import fields, osv\n'), ((1293, 146... |
"""Search-related testing utilities."""
import tempfile
import time
from contextlib import contextmanager
import haystack
from django.conf import settings
from django.core.management import call_command
from djblets.siteconfig.models import SiteConfiguration
from reviewboard.admin.siteconfig import load_site_config
... | [
"django.core.management.call_command",
"reviewboard.admin.siteconfig.load_site_config",
"time.sleep",
"tempfile.mkdtemp",
"djblets.siteconfig.models.SiteConfiguration.objects.get_current"
] | [((384, 432), 'django.core.management.call_command', 'call_command', (['"""rebuild_index"""'], {'interactive': '(False)'}), "('rebuild_index', interactive=False)\n", (396, 432), False, 'from django.core.management import call_command\n'), ((768, 783), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (778, 783), ... |
# Copyright (C) 2015 <NAME>
import json
import os.path
from remoot import pythonstarter, smartstarter
import anycall
from pydron.backend import worker
from pydron.interpreter import scheduler, strategies
from twisted.internet import defer
preload_packages = []
def load_config(configfile=None):
if not config... | [
"anycall.create_tcp_rpc_system",
"pydron.backend.worker.Pool",
"pydron.interpreter.scheduler.Scheduler",
"remoot.pythonstarter.LocalStarter",
"twisted.internet.defer.DeferredList",
"pydron.backend.worker.WorkerStarter",
"json.load",
"pydron.interpreter.strategies.TrivialSchedulingStrategy",
"pydron.... | [((1718, 1753), 'pydron.interpreter.scheduler.Scheduler', 'scheduler.Scheduler', (['pool', 'strategy'], {}), '(pool, strategy)\n', (1737, 1753), False, 'from pydron.interpreter import scheduler, strategies\n'), ((2372, 2385), 'pydron.backend.worker.Pool', 'worker.Pool', ([], {}), '()\n', (2383, 2385), False, 'from pydr... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This plugin provides customization of the header displayed by pytest for
reporting purposes.
"""
import os
import sys
import datetime
import locale
import math
from collections import OrderedDict
from astropy.tests.helper import ignore_warnings
from ... | [
"collections.OrderedDict",
"sys.getfilesystemencoding",
"sys.getdefaultencoding",
"platform.platform",
"locale.getpreferredencoding",
"datetime.datetime.now",
"astropy.tests.helper.ignore_warnings",
"astropy.utils.introspection.resolve_name"
] | [((394, 521), 'collections.OrderedDict', 'OrderedDict', (["[('Numpy', 'numpy'), ('Scipy', 'scipy'), ('Matplotlib', 'matplotlib'), (\n 'h5py', 'h5py'), ('Pandas', 'pandas')]"], {}), "([('Numpy', 'numpy'), ('Scipy', 'scipy'), ('Matplotlib',\n 'matplotlib'), ('h5py', 'h5py'), ('Pandas', 'pandas')])\n", (405, 521), F... |
#!/usr/local/bin/python3.6
"""
Copyright (c) 2015-2019 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyr... | [
"sys.path.insert",
"re.compile",
"shlex.split",
"ujson.dumps",
"params.update_params",
"ujson.loads",
"log_helper.reverse_log_reader"
] | [((1554, 1607), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""/usr/local/opnsense/site-python"""'], {}), "(0, '/usr/local/opnsense/site-python')\n", (1569, 1607), False, 'import sys\n'), ((1849, 1874), 'params.update_params', 'update_params', (['parameters'], {}), '(parameters)\n', (1862, 1874), False, 'from param... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | [
"wx.ListCtrl.__init__",
"DictionaryEntryDialog.DictionaryEntryDialog",
"wx.Menu",
"wx.MessageDialog",
"wx.EVT_MENU"
] | [((970, 1108), 'wx.ListCtrl.__init__', 'wx.ListCtrl.__init__', (['self', 'parent', 'PROJECTSETTINGS_LISTDICTIONARY_ID'], {'size': 'wx.DefaultSize', 'style': '(wx.LC_REPORT | wx.LC_SORT_ASCENDING)'}), '(self, parent, PROJECTSETTINGS_LISTDICTIONARY_ID, size=\n wx.DefaultSize, style=wx.LC_REPORT | wx.LC_SORT_ASCENDING)... |
from __future__ import print_function, division
import numpy as np
import Nio
import time, os
#
# Creating a file
#
init_time = time.clock()
ncfile = 'test-large.nc'
if (os.path.exists(ncfile)):
os.system("/bin/rm -f " + ncfile)
opt = Nio.options()
opt.Format = "LargeFile"
opt.PreFill = False
file = Nio.open_file(nc... | [
"os.path.exists",
"time.clock",
"numpy.empty",
"Nio.options",
"Nio.open_file",
"os.system"
] | [((129, 141), 'time.clock', 'time.clock', ([], {}), '()\n', (139, 141), False, 'import time, os\n'), ((171, 193), 'os.path.exists', 'os.path.exists', (['ncfile'], {}), '(ncfile)\n', (185, 193), False, 'import time, os\n'), ((238, 251), 'Nio.options', 'Nio.options', ([], {}), '()\n', (249, 251), False, 'import Nio\n'), ... |
#This file is part of ElectricEye.
#SPDX-License-Identifier: Apache-2.0
#Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you un... | [
"check_register.CheckRegister",
"boto3.client",
"datetime.datetime.utcnow"
] | [((923, 938), 'check_register.CheckRegister', 'CheckRegister', ([], {}), '()\n', (936, 938), False, 'from check_register import CheckRegister\n'), ((969, 988), 'boto3.client', 'boto3.client', (['"""ecs"""'], {}), "('ecs')\n", (981, 988), False, 'import boto3\n'), ((9747, 9773), 'datetime.datetime.utcnow', 'datetime.dat... |
import unittest
from .mocks import BotoSessionMock
from push_notification import apns
class APNSTestCase(unittest.TestCase):
def_apns_category = 'MGDailyDealCategory'
# def setUp(self):
# def tearDown(self):
# push_notification
# push_background
# make_new_deal_message
# make_delta_... | [
"push_notification.apns.publish_message",
"push_notification.apns._make_background_notification",
"push_notification.apns.make_delta_message"
] | [((836, 868), 'push_notification.apns.make_delta_message', 'apns.make_delta_message', (['message'], {}), '(message)\n', (859, 868), False, 'from push_notification import apns\n'), ((1442, 1474), 'push_notification.apns.make_delta_message', 'apns.make_delta_message', (['message'], {}), '(message)\n', (1465, 1474), False... |
import analyseGithub
def test_containsGithubURL_empty():
assert not analyseGithub.containsGitHubURL("")
def test_containsGithubURL_noUrl():
assert not analyseGithub.containsGitHubURL("Some test tweet")
def test_containsGithubURL_url():
repo = "https://github.com/git/git"
assert analyseGithub.contains... | [
"analyseGithub.containsGitHubURL",
"analyseGithub.extractGitHubLink"
] | [((298, 335), 'analyseGithub.containsGitHubURL', 'analyseGithub.containsGitHubURL', (['repo'], {}), '(repo)\n', (329, 335), False, 'import analyseGithub\n'), ((73, 108), 'analyseGithub.containsGitHubURL', 'analyseGithub.containsGitHubURL', (['""""""'], {}), "('')\n", (104, 108), False, 'import analyseGithub\n'), ((161,... |
###############################################################################
# Author: <NAME>
# Project: ARC-II: Convolutional Matching Model
# Date Created: 7/18/2017
#
# File Description: This script contains ranking evaluation functions.
######################################################################... | [
"torch.sort",
"numpy.log2",
"torch.nonzero"
] | [((708, 746), 'torch.sort', 'torch.sort', (['logits', '(1)'], {'descending': '(True)'}), '(logits, 1, descending=True)\n', (718, 746), False, 'import torch, numpy\n'), ((1603, 1641), 'torch.sort', 'torch.sort', (['logits', '(1)'], {'descending': '(True)'}), '(logits, 1, descending=True)\n', (1613, 1641), False, 'import... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"visualize.visualize_pose",
"cv2.imshow",
"numpy.array",
"infer.bench_log",
"os.path.exists",
"infer.get_test_images",
"cv2.VideoWriter",
"paddle.enable_static",
"os.path.split",
"cv2.VideoWriter_fourcc",
"cv2.waitKey",
"utils.get_current_memory_mb",
"cv2.cvtColor",
"det_keypoint_unite_uti... | [((5452, 5494), 'os.path.join', 'os.path.join', (['FLAGS.output_dir', 'video_name'], {}), '(FLAGS.output_dir, video_name)\n', (5464, 5494), False, 'import os\n'), ((5508, 5539), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'mp4v'"], {}), "(*'mp4v')\n", (5530, 5539), False, 'import cv2\n'), ((5554, 5609), 'cv... |
import random
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from mla.base import BaseEstimator
from mla.metrics.distance import euclidean_distance
random.seed(1111)
class KMeans(BaseEstimator):
"""Partition a dataset into K clusters.
Finds clusters by repeatedly assigning each d... | [
"seaborn.set",
"random.choice",
"seaborn.color_palette",
"mla.metrics.distance.euclidean_distance",
"numpy.where",
"random.seed",
"numpy.take",
"numpy.array",
"numpy.empty",
"matplotlib.pyplot.scatter",
"random.random",
"matplotlib.pyplot.show"
] | [((177, 194), 'random.seed', 'random.seed', (['(1111)'], {}), '(1111)\n', (188, 194), False, 'import random\n'), ((2761, 2785), 'numpy.empty', 'np.empty', (['self.n_samples'], {}), '(self.n_samples)\n', (2769, 2785), True, 'import numpy as np\n'), ((4152, 4167), 'random.random', 'random.random', ([], {}), '()\n', (4165... |
import os
import sys
import argparse
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
# from sru import *
import dataloader
import modules
class Model(nn.Module):
def __init__(self, embe... | [
"dataloader.create_batches_x",
"torch.nn.Dropout",
"dataloader.load_embedding",
"torch.nn.CrossEntropyLoss",
"argparse.ArgumentParser",
"torch.nn.LSTM",
"torch.max",
"modules.CNN_Text",
"os.path.join",
"dataloader.create_batches",
"dataloader.read_corpus",
"torch.nn.Linear",
"torch.no_grad",... | [((3781, 3802), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (3800, 3802), True, 'import torch.nn as nn\n'), ((5099, 5121), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (5115, 5121), False, 'import sys\n'), ((8341, 8416), 'dataloader.create_batches', 'dataloader.crea... |
import datetime
import io
import os
import tweepy
from dotenv import load_dotenv
from PIL import Image, ImageDraw, ImageFont
class Twitter:
"""
A class used to manage the connection with the Twitter API
...
Methods
-------
post_tweet(solver_answers, nyt_answers, pangrams)
Creates the... | [
"PIL.Image.new",
"os.environ.get",
"PIL.ImageFont.truetype",
"io.BytesIO",
"dotenv.load_dotenv",
"tweepy.API",
"PIL.ImageDraw.Draw",
"datetime.date.today",
"tweepy.OAuthHandler"
] | [((413, 426), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (424, 426), False, 'from dotenv import load_dotenv\n'), ((445, 474), 'os.environ.get', 'os.environ.get', (['"""TWITTER_API"""'], {}), "('TWITTER_API')\n", (459, 474), False, 'import os\n'), ((500, 536), 'os.environ.get', 'os.environ.get', (['"""TWITTE... |
# -*- coding: utf-8 -*-
"""
:Author: <NAME>
"""
import logging
import numpy as np
import scipy as sp
import collections
import itertools
from model.modelTemplate import Model
class BPE(Model):
"""The Bayesian predictor model
Attributes
----------
Name : string
The ... | [
"numpy.repeat",
"scipy.stats.dirichlet",
"numpy.array",
"numpy.sum",
"numpy.apply_along_axis"
] | [((2391, 2407), 'numpy.array', 'np.array', (['[0, 1]'], {}), '([0, 1])\n', (2399, 2407), True, 'import numpy as np\n'), ((3481, 3512), 'numpy.array', 'np.array', (['self.recDirichletVals'], {}), '(self.recDirichletVals)\n', (3489, 3512), True, 'import numpy as np\n'), ((8204, 8222), 'numpy.sum', 'np.sum', (['dirVals', ... |
from django.db.models.signals import post_init
from factory import DjangoModelFactory, Sequence, SubFactory
from factory.django import mute_signals
from affiliates.banners import models
class CategoryFactory(DjangoModelFactory):
FACTORY_FOR = models.Category
name = Sequence(lambda n: 'test{0}'.format(n))
... | [
"factory.django.mute_signals",
"factory.SubFactory"
] | [((628, 651), 'factory.django.mute_signals', 'mute_signals', (['post_init'], {}), '(post_init)\n', (640, 651), False, 'from factory.django import mute_signals\n'), ((1362, 1385), 'factory.django.mute_signals', 'mute_signals', (['post_init'], {}), '(post_init)\n', (1374, 1385), False, 'from factory.django import mute_si... |
#! /usr/bin/env python
"""Toolbox for unbalanced dataset in machine learning."""
from setuptools import setup, find_packages
import os
import sys
import setuptools
from distutils.command.build_py import build_py
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
descr = """Tool... | [
"os.path.exists",
"setuptools.find_packages",
"numpy.distutils.misc_util.Configuration",
"sys.exit",
"os.remove"
] | [((1708, 1734), 'os.path.exists', 'os.path.exists', (['"""MANIFEST"""'], {}), "('MANIFEST')\n", (1722, 1734), False, 'import os\n'), ((1836, 1881), 'numpy.distutils.misc_util.Configuration', 'Configuration', (['None', 'parent_package', 'top_path'], {}), '(None, parent_package, top_path)\n', (1849, 1881), False, 'from n... |
#!/usr/bin/env python
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Rackspace Inc."
__email__ = "<EMAIL>"
from mongo_schema import schema_engine
import os
def get_schema_files(schemas_dirpath):
""" get list of js / json files resided in dirpath param. """
res = []
for fname in os.listdir(schemas... | [
"mongo_schema.schema_engine.create_schema_engine",
"os.listdir",
"os.path.join",
"os.path.basename"
] | [((302, 329), 'os.listdir', 'os.listdir', (['schemas_dirpath'], {}), '(schemas_dirpath)\n', (312, 329), False, 'import os\n'), ((803, 839), 'os.path.join', 'os.path.join', (['schemas_dirpath', 'fname'], {}), '(schemas_dirpath, fname)\n', (815, 839), False, 'import os\n'), ((889, 953), 'mongo_schema.schema_engine.create... |
from random import randint
from django.core.management.base import BaseCommand
from django.db import transaction
from faker import Faker
from hn_users.models import HNUser, User
from links.models import Link, Vote
faker = Faker()
class Command(BaseCommand):
help = "Generate Links from a small user subset"
... | [
"django.db.transaction.atomic",
"hn_users.models.HNUser",
"links.models.Link",
"links.models.Vote",
"hn_users.models.HNUser.objects.count",
"hn_users.models.User",
"faker.Faker",
"hn_users.models.HNUser.objects.all",
"random.randint"
] | [((225, 232), 'faker.Faker', 'Faker', ([], {}), '()\n', (230, 232), False, 'from faker import Faker\n'), ((511, 531), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (529, 531), False, 'from django.db import transaction\n'), ((1207, 1229), 'hn_users.models.HNUser.objects.count', 'HNUser.objects.... |
# -*- coding: utf-8 -*-
import scrapy
import json
from locations.items import GeojsonPointItem
class CenexSpider(scrapy.Spider):
name = "cenex"
item_attributes = {"brand": "Cenex", "brand_wikidata": "Q5011381"}
allowed_domains = ["www.cenex.com"]
def start_requests(self):
yield scrapy.http.Js... | [
"scrapy.http.JsonRequest"
] | [((306, 1045), 'scrapy.http.JsonRequest', 'scrapy.http.JsonRequest', (['"""https://www.cenex.com/Common/Services/InteractiveMap.svc/GetLocations"""'], {'method': '"""POST"""', 'data': "{'SearchRequest': {'Metadata': {'MapId': '', 'Categories': []}, 'Query': {\n 'SearchLat': 0, 'SearchLong': 0, 'LocationTypes': [1, 1... |
import os
import multiprocessing
if os.name != "nt":
# https://bugs.python.org/issue41567
import multiprocessing.popen_spawn_posix # type: ignore
from pathlib import Path
from typing import Optional
# PROFILES_DIR must be set before the other flags
# It also gets set in main.py and in set_from_args because t... | [
"os.getenv",
"pathlib.Path",
"multiprocessing.get_context",
"os.path.abspath",
"os.path.expanduser"
] | [((429, 452), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (447, 452), False, 'import os\n'), ((496, 547), 'os.getenv', 'os.getenv', (['"""DBT_PROFILES_DIR"""', 'DEFAULT_PROFILES_DIR'], {}), "('DBT_PROFILES_DIR', DEFAULT_PROFILES_DIR)\n", (505, 547), False, 'import os\n'), ((1933, 1947), 'o... |
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from src.python.baselines import *
from pymongo import MongoClient
from tqdm import tqdm
import tensorflow as tf
### Keras
from keras import optimizers
from keras.models import Model
from keras.layers import Input... | [
"keras.optimizers.Adam",
"keras.callbacks.LearningRateScheduler",
"argparse.ArgumentParser",
"math.floor",
"keras.layers.Concatenate",
"tensorflow.Session",
"tqdm.tqdm",
"keras.backend.set_session",
"keras.layers.GlobalMaxPooling1D",
"keras.layers.Input",
"sklearn.metrics.log_loss",
"keras.mod... | [((865, 877), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (875, 877), True, 'import tensorflow as tf\n'), ((878, 897), 'keras.backend.set_session', 'K.set_session', (['sess'], {}), '(sess)\n', (891, 897), True, 'from keras import backend as K\n'), ((5645, 5665), 'keras.layers.Input', 'Input', ([], {'shape': '... |
import matplotlib.pyplot as plt
import openpyxl
import sys
from fs import FS
from journals import Journals
from utils import load_sheet
from utils import log
from word import Word
YEARS = [2017, 2018, 2019, 2020, 2021]
class InBiMa():
def __init__(self, is_new_folder=False):
self.fs = FS(is_new_folder... | [
"utils.log",
"word.Word",
"matplotlib.pyplot.savefig",
"utils.load_sheet",
"matplotlib.pyplot.plot",
"fs.FS",
"journals.Journals",
"matplotlib.pyplot.legend"
] | [((304, 321), 'fs.FS', 'FS', (['is_new_folder'], {}), '(is_new_folder)\n', (306, 321), False, 'from fs import FS\n'), ((436, 470), 'utils.log', 'log', (['"""Excel file is opened"""', '"""res"""'], {}), "('Excel file is opened', 'res')\n", (439, 470), False, 'from utils import log\n'), ((492, 519), 'utils.load_sheet', '... |
from django.forms import (
Form, CharField, Textarea, PasswordInput, ChoiceField, DateField,
ImageField, BooleanField, IntegerField, MultipleChoiceField
)
from django import forms
from fb.models import UserProfile
class UserPostForm(Form):
text = CharField(widget=Textarea(
attrs={'rows': 1, 'cols... | [
"django.forms.BooleanField",
"django.forms.CharField",
"django.forms.DateField",
"django.forms.ChoiceField",
"django.forms.ImageField",
"django.forms.IntegerField",
"django.forms.Textarea",
"django.forms.MultipleChoiceField"
] | [((606, 630), 'django.forms.CharField', 'CharField', ([], {'max_length': '(30)'}), '(max_length=30)\n', (615, 630), False, 'from django.forms import Form, CharField, Textarea, PasswordInput, ChoiceField, DateField, ImageField, BooleanField, IntegerField, MultipleChoiceField\n'), ((646, 677), 'django.forms.CharField', '... |
from flask import Flask, jsonify, request, render_template, redirect
from flask_pymongo import PyMongo
from werkzeug import secure_filename
import base64
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'restdb'
app.config['MONGO_URI'] = 'mongodb://localhost:27017/restdb'
mongo = PyMongo(app)
@app.route('/')
def ... | [
"flask.render_template",
"flask.Flask",
"flask_pymongo.PyMongo",
"werkzeug.secure_filename",
"flask.jsonify"
] | [((161, 176), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (166, 176), False, 'from flask import Flask, jsonify, request, render_template, redirect\n'), ((286, 298), 'flask_pymongo.PyMongo', 'PyMongo', (['app'], {}), '(app)\n', (293, 298), False, 'from flask_pymongo import PyMongo\n'), ((338, 367), 'flas... |
""" Utilities
:Author: <NAME> <<EMAIL>>
:Date: 2016-11-10
:Copyright: 2016, Karr Lab
:License: MIT
"""
from obj_tables import get_models as base_get_models
from wc_lang import core
from wc_lang import io
from wc_utils.util import git
def get_model_size(model):
""" Get numbers of model components
Args:
... | [
"obj_tables.get_models"
] | [((1907, 1950), 'obj_tables.get_models', 'base_get_models', ([], {'module': 'core', 'inline': 'inline'}), '(module=core, inline=inline)\n', (1922, 1950), True, 'from obj_tables import get_models as base_get_models\n')] |
import synapse.common as s_common
import synapse.tests.utils as s_t_utils
import synapse.tools.autodoc as s_autodoc
class TestAutoDoc(s_t_utils.SynTest):
async def test_tools_autodoc_docmodel(self):
with self.getTestDir() as path:
argv = ['--doc-model', '--savedir', path]
outp... | [
"synapse.tools.autodoc.main",
"synapse.common.genfile"
] | [((422, 467), 'synapse.common.genfile', 's_common.genfile', (['path', '"""datamodel_types.rst"""'], {}), "(path, 'datamodel_types.rst')\n", (438, 467), True, 'import synapse.common as s_common\n'), ((791, 836), 'synapse.common.genfile', 's_common.genfile', (['path', '"""datamodel_forms.rst"""'], {}), "(path, 'datamodel... |
from abc import ABC, abstractmethod
from django.test import TestCase
from rest_framework.generics import GenericAPIView
from rest_framework.test import APIRequestFactory
from apps.cars.factory import UserFactory
class AbstractBaseTest(object):
class AbstractBaseApiTestCase(TestCase, ABC):
"""
A... | [
"rest_framework.test.APIRequestFactory",
"apps.cars.factory.UserFactory.create",
"rest_framework.generics.GenericAPIView.as_view"
] | [((657, 681), 'rest_framework.generics.GenericAPIView.as_view', 'GenericAPIView.as_view', ([], {}), '()\n', (679, 681), False, 'from rest_framework.generics import GenericAPIView\n'), ((447, 467), 'apps.cars.factory.UserFactory.create', 'UserFactory.create', ([], {}), '()\n', (465, 467), False, 'from apps.cars.factory ... |
"""
A simple templating tool for Dockerfiles
"""
import sys
import os
import click
import jinja2
import yaml
@click.group()
def cli():
""" @Unimplemented """
pass
@cli.command()
@click.argument("template", required=True, type=str)
@click.option("-y", "--yaml_file", required=True,
help="Yaml ... | [
"click.argument",
"click.group",
"click.option",
"os.path.expandvars",
"yaml.load",
"sys.stdout.flush",
"sys.stdout.write"
] | [((114, 127), 'click.group', 'click.group', ([], {}), '()\n', (125, 127), False, 'import click\n'), ((193, 244), 'click.argument', 'click.argument', (['"""template"""'], {'required': '(True)', 'type': 'str'}), "('template', required=True, type=str)\n", (207, 244), False, 'import click\n'), ((246, 350), 'click.option', ... |
#!/usr/bin/env python
# coding: utf-8
# In[18]:
# this definition exposes all python module imports that should be available in all subsequent commands
import json
import numpy as np
import pandas as pd
from causalnex.structure import DAGRegressor
from sklearn.model_selection import cross_val_score
from sklear... | [
"pandas.Series",
"numpy.mean",
"pandas.read_csv",
"sklearn.preprocessing.StandardScaler",
"json.load",
"pandas.DataFrame",
"causalnex.structure.DAGRegressor",
"sklearn.model_selection.KFold"
] | [((1022, 1146), 'causalnex.structure.DAGRegressor', 'DAGRegressor', ([], {'alpha': '(0.1)', 'beta': '(0.9)', 'fit_intercept': '(True)', 'hidden_layer_units': 'None', 'dependent_target': '(True)', 'enforce_dag': '(True)'}), '(alpha=0.1, beta=0.9, fit_intercept=True, hidden_layer_units=\n None, dependent_target=True, ... |
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation
matplotlib.use('Agg')
import math
import numpy as np
import sys
from os.path import join, isfile
import warnings
warnings.filterwarnings("ignore")
def gda(x, y):
x = x.T
y = y.T
# phi = P(y = 1)
# mu[i] = mea... | [
"warnings.filterwarnings",
"numpy.mean",
"matplotlib.use",
"numpy.log",
"os.path.join",
"numpy.linalg.det",
"numpy.sum",
"numpy.array",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.linspace",
"numpy.outer",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((91, 112), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (105, 112), False, 'import matplotlib\n'), ((206, 239), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (229, 239), False, 'import warnings\n'), ((547, 556), 'numpy.sum', 'np.sum', (['y'], {}... |
import bcrypt
salt = bcrypt.gensalt()
def generate_hash(passwd, salt=salt):
return str(bcrypt.hashpw(passwd, salt))
def match_password(req_pwd, db_pwd):
db_pwd = db_pwd.replace('b\'','').replace('\'','').encode('utf-8')
return db_pwd == bcrypt.hashpw(req_pwd, db_pwd)
| [
"bcrypt.gensalt",
"bcrypt.hashpw"
] | [((22, 38), 'bcrypt.gensalt', 'bcrypt.gensalt', ([], {}), '()\n', (36, 38), False, 'import bcrypt\n'), ((93, 120), 'bcrypt.hashpw', 'bcrypt.hashpw', (['passwd', 'salt'], {}), '(passwd, salt)\n', (106, 120), False, 'import bcrypt\n'), ((253, 283), 'bcrypt.hashpw', 'bcrypt.hashpw', (['req_pwd', 'db_pwd'], {}), '(req_pwd,... |
"""
Module for Serialization and Deserialization of a KNX Disconnect Request information.
Disconnect requests are used to disconnect a tunnel from a KNX/IP device.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from xknx.exceptions import CouldNotParseKNXIP
from .body import KNXIPBody
from ... | [
"xknx.exceptions.CouldNotParseKNXIP"
] | [((1172, 1226), 'xknx.exceptions.CouldNotParseKNXIP', 'CouldNotParseKNXIP', (['"""Disconnect info has wrong length"""'], {}), "('Disconnect info has wrong length')\n", (1190, 1226), False, 'from xknx.exceptions import CouldNotParseKNXIP\n')] |
from src.sqlite_helper import create_message_table, drop_message_table
"""
This script will create a SQLite table for you, and should be one time setup
The table name is message which will store all the Post message
"""
create_message_table()
"""
If you need to drop the message table, un-comment the following code ... | [
"src.sqlite_helper.create_message_table"
] | [((222, 244), 'src.sqlite_helper.create_message_table', 'create_message_table', ([], {}), '()\n', (242, 244), False, 'from src.sqlite_helper import create_message_table, drop_message_table\n')] |
import typing as t
from typing import TYPE_CHECKING
import numpy as np
import torch
import pytest
import imageio
from detectron2 import model_zoo
from detectron2.data import transforms as T
from detectron2.config import get_cfg
from detectron2.modeling import build_model
import bentoml
if TYPE_CHECKING:
from det... | [
"bentoml.detectron.save",
"detectron2.modeling.build_model",
"torch.as_tensor",
"detectron2.config.get_cfg",
"bentoml.models.get",
"bentoml.detectron.load_runner",
"imageio.imread",
"pytest.mark.parametrize",
"detectron2.model_zoo.get_checkpoint_url",
"detectron2.model_zoo.get_config_file",
"ben... | [((1848, 1898), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""', 'name': '"""image_array"""'}), "(scope='module', name='image_array')\n", (1862, 1898), False, 'import pytest\n'), ((2357, 2410), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""metadata"""', "[{'acc': 0.876}]"], {}), "('metad... |
import pytest
from pypospack.potential import EamPotential
symbols = ['Al']
func_pair_name = "bornmayer"
func_density_name = "eam_dens_exp"
func_embedding_name = "fs"
expected_parameter_names_pair_potential = []
expected_parameter_names_density_function = []
expected_parameter_names_embedding_function = []
expected_... | [
"pypospack.potential.EamPotential"
] | [((733, 861), 'pypospack.potential.EamPotential', 'EamPotential', ([], {'symbols': 'symbols', 'func_pair': 'func_pair_name', 'func_density': 'func_density_name', 'func_embedding': 'func_embedding_name'}), '(symbols=symbols, func_pair=func_pair_name, func_density=\n func_density_name, func_embedding=func_embedding_na... |
from typing import Dict
from main.helpers.print_helper import PrintHelper
class Enricher(object):
def __init__(self, enricher_type: str, header: str) -> None:
self.enricher_type = enricher_type
self.header = header
def get_information(self, packet: Dict[str, str], information_dict) -> None:
... | [
"main.helpers.print_helper.PrintHelper.print_nothing"
] | [((371, 416), 'main.helpers.print_helper.PrintHelper.print_nothing', 'PrintHelper.print_nothing', (['self.enricher_type'], {}), '(self.enricher_type)\n', (396, 416), False, 'from main.helpers.print_helper import PrintHelper\n')] |
import coloredlogs
coloredlogs.install()
custom_logger = logging.getLogger(name)
coloredlogs.install(level="INFO", logger=custom_logger)
| [
"coloredlogs.install"
] | [((20, 41), 'coloredlogs.install', 'coloredlogs.install', ([], {}), '()\n', (39, 41), False, 'import coloredlogs\n'), ((82, 137), 'coloredlogs.install', 'coloredlogs.install', ([], {'level': '"""INFO"""', 'logger': 'custom_logger'}), "(level='INFO', logger=custom_logger)\n", (101, 137), False, 'import coloredlogs\n')] |