code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2018, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pysnmp/license.html
#
try:
from hashlib import sha1
except ImportError:
import sha
sha1 = sha.new
from pyasn1.type import univ
from pysnmp.proto.secmod.rfc3414.auth import base
from pysnmp... | [
"pyasn1.type.univ.OctetString",
"pysnmp.proto.secmod.rfc3414.localkey.hashPassphraseSHA",
"pysnmp.proto.error.StatusInformation",
"pysnmp.proto.error.ProtocolError",
"pysnmp.proto.secmod.rfc3414.localkey.localizeKeySHA"
] | [((413, 440), 'pyasn1.type.univ.OctetString', 'univ.OctetString', (['((0,) * 12)'], {}), '((0,) * 12)\n', (429, 440), False, 'from pyasn1.type import univ\n'), ((721, 756), 'pysnmp.proto.secmod.rfc3414.localkey.hashPassphraseSHA', 'localkey.hashPassphraseSHA', (['authKey'], {}), '(authKey)\n', (747, 756), False, 'from ... |
import torch.nn as nn
import torch.nn.functional as F
class FocalLoss(nn.Module):
def __init__(self, gamma=2):
super().__init__()
self.gamma = gamma
# TODO refactor
def forward(self, outputs, targets):
if targets.size() != outputs.size():
raise ValueError(
... | [
"torch.nn.functional.logsigmoid"
] | [((637, 683), 'torch.nn.functional.logsigmoid', 'F.logsigmoid', (['(-outputs * (targets * 2.0 - 1.0))'], {}), '(-outputs * (targets * 2.0 - 1.0))\n', (649, 683), True, 'import torch.nn.functional as F\n')] |
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | [
"cinder.keymgr.key.SymmetricKey",
"cinder.context.RequestContext",
"cinder.keymgr.conf_key_mgr.ConfKeyManager"
] | [((1365, 1394), 'cinder.keymgr.conf_key_mgr.ConfKeyManager', 'conf_key_mgr.ConfKeyManager', ([], {}), '()\n', (1392, 1394), False, 'from cinder.keymgr import conf_key_mgr\n'), ((1490, 1528), 'cinder.context.RequestContext', 'context.RequestContext', (['"""fake"""', '"""fake"""'], {}), "('fake', 'fake')\n", (1512, 1528)... |
#!/usr/bin/env python3
"""This script is used to generate the tables for `charmap-reference.rst`.
Uses the tabulate module from PyPI.
"""
import argparse
import unicodedata
from typing import Iterable, Iterator
from tabulate import tabulate
import tcod.tileset
def get_charmaps() -> Iterator[str]:
"""Return an ... | [
"tabulate.tabulate",
"argparse.ArgumentParser",
"argparse.FileType"
] | [((1443, 1483), 'tabulate.tabulate', 'tabulate', (['table', 'headers'], {'tablefmt': '"""rst"""'}), "(table, headers, tablefmt='rst')\n", (1451, 1483), False, 'from tabulate import tabulate\n'), ((1519, 1610), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate an RST table for a tco... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
plt.figure(figsize=(6.6, 3), dpi=90)
x = np.linspace(-2*np.pi, 2*np.pi, 1e3)
plt.plot(x, np.sin(x), label="$\sin(x)$")
plt.plot(x, np.cos(x), label="$\sin(x)$")
plt.xlim((np.min(x), np.max(x)))
plt.ylim((-1.1, 1.1))
plt.x... | [
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.min",
"numpy.max",
"numpy.linspace",
"numpy.random.normal",
"numpy.cos",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((96, 132), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(6.6, 3)', 'dpi': '(90)'}), '(figsize=(6.6, 3), dpi=90)\n', (106, 132), True, 'import matplotlib.pyplot as plt\n'), ((137, 179), 'numpy.linspace', 'np.linspace', (['(-2 * np.pi)', '(2 * np.pi)', '(1000.0)'], {}), '(-2 * np.pi, 2 * np.pi, 1000.0)\n... |
#!/usr/bin/env python
import consul
import urllib.parse
import sys
import re
import os
from pprint import pprint
from argparse import ArgumentParser
VERSION = "0.5.0"
args = None
consul_inst_cache = {}
def _get_consul_for_url(consul_url) -> consul.Consul:
if consul_url not in consul_inst_cache:
parse... | [
"argparse.ArgumentParser",
"consul.Consul",
"os.environ.get",
"pprint.pprint",
"re.compile"
] | [((5153, 5169), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (5167, 5169), False, 'from argparse import ArgumentParser\n'), ((716, 777), 'consul.Consul', 'consul.Consul', ([], {'host': 'host', 'port': 'port', 'scheme': 'parsed_url.scheme'}), '(host=host, port=port, scheme=parsed_url.scheme)\n', (729, ... |
import logging
import click
from vogue.load.sample import load_one, load_all, load_recent, load_one_dry, load_all_dry
from datetime import date, timedelta
from genologics.entities import Sample
LOG = logging.getLogger(__name__)
@click.command("sample", short_help="load sample/samples into db.")
@click.option("-s", ... | [
"vogue.load.sample.load_all",
"genologics.entities.Sample",
"click.option",
"datetime.date.today",
"click.command",
"vogue.load.sample.load_all_dry",
"datetime.timedelta",
"vogue.load.sample.load_recent",
"vogue.load.sample.load_one",
"vogue.load.sample.load_one_dry",
"logging.getLogger",
"cli... | [((202, 229), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (219, 229), False, 'import logging\n'), ((233, 299), 'click.command', 'click.command', (['"""sample"""'], {'short_help': '"""load sample/samples into db."""'}), "('sample', short_help='load sample/samples into db.')\n", (246, 29... |
# -*- coding: utf-8 -*-
# Copyright 2015-2019 grafana-dashboard-builder contributors
#
# 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 ... | [
"urllib.request.HTTPHandler",
"urllib.request.HTTPSHandler",
"json.loads",
"http.cookiejar.CookieJar",
"json.dumps",
"requests_kerberos.HTTPKerberosAuth",
"urllib.request.HTTPDefaultErrorHandler",
"logging.getLogger"
] | [((1332, 1359), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1349, 1359), False, 'import logging\n'), ((1665, 1694), 'urllib.request.HTTPHandler', 'HTTPHandler', ([], {'debuglevel': 'debug'}), '(debuglevel=debug)\n', (1676, 1694), False, 'from urllib.request import build_opener, HTTPHa... |
from django.urls import path
from core.apps import CoreConfig
from core import views
app_name = CoreConfig.name
urlpatterns = [
path('get', views.SearchViewSet.as_view({'post': 'search'}),
name='search'),
path('number_of_links', views.SearchViewSet.as_view({'post': 'number_of_links'}),
name... | [
"core.views.SearchViewSet.as_view"
] | [((147, 194), 'core.views.SearchViewSet.as_view', 'views.SearchViewSet.as_view', (["{'post': 'search'}"], {}), "({'post': 'search'})\n", (174, 194), False, 'from core import views\n'), ((249, 305), 'core.views.SearchViewSet.as_view', 'views.SearchViewSet.as_view', (["{'post': 'number_of_links'}"], {}), "({'post': 'numb... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui... | [
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QStatusBar",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QTabWidget"
] | [((510, 539), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['MainWindow'], {}), '(MainWindow)\n', (527, 539), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((619, 655), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.centralwidget'], {}), '(self.centralwidget)\n', (635, 655), False, 'from PyQt5 impo... |
#!/usr/bin/env python
"""
Author: <NAME>
Date: 11.2018
# Description
Map model metabolites and reactions to metanetx identifiers using KEGG, metacyc and BiGG annotations.
"""
import cobra
import pandas as pd
from pathlib import Path
import libchebipy
def map_model_metabolites(model, metanetx_fn):
df = pd.read_csv... | [
"pandas.read_csv",
"pathlib.Path",
"pandas.DataFrame"
] | [((309, 369), 'pandas.read_csv', 'pd.read_csv', (['metanetx_fn'], {'header': 'None', 'sep': '"""\t"""', 'comment': '"""#"""'}), "(metanetx_fn, header=None, sep='\\t', comment='#')\n", (320, 369), True, 'import pandas as pd\n'), ((2445, 2508), 'pandas.DataFrame', 'pd.DataFrame', (['new_df_list'], {'columns': "['Met ID',... |
"""
This module provides utility methods.
"""
import datetime
import os
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from plotnine import *
from statsmodels.tsa.statespace.kalman_smoother import SmootherResults
from statsmodels.tsa.statespace.mlemodel import MLEResults, MLEResultsWrapper... | [
"numpy.abs",
"numpy.argmax",
"matplotlib.pyplot.suptitle",
"numpy.argmin",
"matplotlib.pyplot.figure",
"numpy.mean",
"os.path.join",
"pandas.DataFrame",
"numpy.multiply",
"numpy.transpose",
"datetime.timedelta",
"matplotlib.pyplot.show",
"numpy.median",
"datetime.datetime",
"datetime.dat... | [((7666, 7680), 'numpy.mean', 'np.mean', (['mases'], {}), '(mases)\n', (7673, 7680), True, 'import numpy as np\n'), ((7696, 7712), 'numpy.median', 'np.median', (['mases'], {}), '(mases)\n', (7705, 7712), True, 'import numpy as np\n'), ((7730, 7745), 'numpy.mean', 'np.mean', (['mdases'], {}), '(mdases)\n', (7737, 7745),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 5 22:43:38 2019
@author: anhtu
"""
from __future__ import division
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import cv2
from util import *
class EmptyLayer(nn.Module):
... | [
"torch.nn.Sequential",
"numpy.fromfile",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat",
"cv2.imread",
"torch.nn.BatchNorm2d",
"torch.nn.Upsample",
"torch.nn.LeakyReLU",
"cv2.resize",
"torch.from_numpy"
] | [((1369, 1384), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (1382, 1384), True, 'import torch.nn as nn\n'), ((9441, 9472), 'cv2.imread', 'cv2.imread', (['"""dog-cycle-car.png"""'], {}), "('dog-cycle-car.png')\n", (9451, 9472), False, 'import cv2\n'), ((9483, 9510), 'cv2.resize', 'cv2.resize', (['img', '(4... |
from typing import Tuple
from vyper.exceptions import TypeMismatch
from vyper.old_codegen.abi import (
ABI_Tuple,
abi_encode,
abi_type_of,
abi_type_of2,
lll_tuple_from_args,
)
from vyper.old_codegen.context import Context
from vyper.old_codegen.keccak256_helper import keccak256_helper
from vyper.ol... | [
"vyper.old_codegen.keccak256_helper.keccak256_helper",
"vyper.old_codegen.abi.lll_tuple_from_args",
"vyper.old_codegen.abi.abi_type_of2",
"vyper.old_codegen.types.types.get_type_for_exact_size",
"vyper.old_codegen.abi.abi_encode",
"vyper.exceptions.TypeMismatch",
"vyper.old_codegen.abi.abi_type_of",
"... | [((2162, 2197), 'vyper.old_codegen.types.types.get_type_for_exact_size', 'get_type_for_exact_size', (['buf_maxlen'], {}), '(buf_maxlen)\n', (2185, 2197), False, 'from vyper.old_codegen.types.types import BaseType, ByteArrayLike, get_type_for_exact_size\n'), ((2865, 2877), 'vyper.old_codegen.parser_utils.getpos', 'getpo... |
import json
import pytest
import re
import yaml
# Functions
# ==============================================================================
# Common checks
def common_tests(data, result):
# General assert
assert result.exit_code == 0
assert result.exception is None
# Structure assert
assert_ro... | [
"pytest.mark.parametrize",
"yaml.load",
"json.load"
] | [((4593, 4845), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""data_filename, role_name"""', "[('./cookiecutter.json', 'role_name'), ('./tests/test_01.json', 'test_01'),\n ('./tests/test_02.json', 'test_02'), ('./tests/test_03.json', 'test_03'\n ), ('./tests/test_04.json', 'test_04')]"], {}), "('data... |
import signal
import time
from zeroos.orchestrator.sal import templates
from js9 import j
class InfluxDB():
def __init__(self, container, ip, port, rpcport):
self.container = container
self.ip = ip
self.port = port
# Only client-server port is forwarded
self.rpcport = ... | [
"js9.j.clients.influxdb.get",
"time.sleep",
"zeroos.orchestrator.sal.templates.render",
"time.time"
] | [((576, 664), 'zeroos.orchestrator.sal.templates.render', 'templates.render', (['"""influxdb.conf"""'], {'ip': 'self.ip', 'port': 'self.port', 'rpcport': 'self.rpcport'}), "('influxdb.conf', ip=self.ip, port=self.port, rpcport=self.\n rpcport)\n", (592, 664), False, 'from zeroos.orchestrator.sal import templates\n')... |
# Youtube Trending Feed Reader
# Written by XZANATOL
from optparse import OptionParser
from pymongo import MongoClient
import pandas as pd
import sys
# Help menu
usage = """
<Script> [Options]
[Options]
-h, --help Shows this help message and exit
-c, --csv Reads data from "Youtube.csv" file
-m, --m... | [
"pymongo.MongoClient",
"sys.exit",
"pandas.read_csv",
"optparse.OptionParser"
] | [((377, 391), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (389, 391), False, 'from optparse import OptionParser\n'), ((717, 741), 'pymongo.MongoClient', 'MongoClient', (['"""127.0.0.1"""'], {}), "('127.0.0.1')\n", (728, 741), False, 'from pymongo import MongoClient\n'), ((886, 912), 'pandas.read_csv', 'p... |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import copy
import time
import radical.utils as ru
from . import states as rps
from . import constants as rpc
# ------------------------------------------------------------------------------
#
class ComputePilot(object):
... | [
"copy.deepcopy",
"radical.utils.cancel_main_thread",
"radical.utils.generate_id",
"time.time",
"radical.utils.Url",
"time.sleep",
"radical.utils.RLock"
] | [((2113, 2191), 'radical.utils.generate_id', 'ru.generate_id', (['"""pilot.%(item_counter)04d"""', 'ru.ID_CUSTOM'], {'ns': 'self._session.uid'}), "('pilot.%(item_counter)04d', ru.ID_CUSTOM, ns=self._session.uid)\n", (2127, 2191), True, 'import radical.utils as ru\n'), ((2510, 2520), 'radical.utils.RLock', 'ru.RLock', (... |
# Oracle OCI - Instance report script
# Version: 2.0 19-February 2020
# Written by: <EMAIL>
#
# This script will create a CSV report for all compute and DB instances (including ADW and ATP)
# in your OCI account, including predefined tags
#
# Instructions:
# - you need to specify two variables and that is Tenan... | [
"oci.identity.IdentityClient",
"oci.identity.models.Compartment",
"shapes.ComputeShape",
"oci.core.ComputeClient",
"oci.core.VirtualNetworkClient",
"oci.database.DatabaseClient",
"oci.pagination.list_call_get_all_results",
"oci.auth.signers.InstancePrincipalsDelegationTokenSigner"
] | [((6383, 6479), 'oci.auth.signers.InstancePrincipalsDelegationTokenSigner', 'oci.auth.signers.InstancePrincipalsDelegationTokenSigner', ([], {'delegation_token': 'delegation_token'}), '(delegation_token=\n delegation_token)\n', (6439, 6479), False, 'import oci\n'), ((6491, 6537), 'oci.identity.IdentityClient', 'oci.... |
r"""
Graded rings of modular forms for Hecke triangle groups
AUTHORS:
- <NAME> (2013): initial version
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2013-2014 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GN... | [
"sage.rings.all.ZZ"
] | [((1650, 1659), 'sage.rings.all.ZZ', 'ZZ', (['group'], {}), '(group)\n', (1652, 1659), False, 'from sage.rings.all import ZZ, QQ, infinity\n')] |
import torch
import torch.nn as nn
from model.backbone.conv import conv_block, ConvEncoder
from model.backbone.resnet import resnet12 as resnet
def deconv_block(in_channels, out_channels, kernel_size=2, stride=2, padding=0, output_padding=0):
return nn.Sequential(
nn.ConvTranspose2d(in_channels,
... | [
"model.backbone.conv.conv_block",
"torch.nn.Unflatten",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.randn",
"model.backbone.conv.ConvEncoder",
"torch.nn.BatchNorm2d",
"model.backbone.resnet.resnet12",
"torch.nn.Linear"
] | [((1148, 1207), 'torch.nn.Unflatten', 'nn.Unflatten', ([], {'dim': '(1)', 'unflattened_size': '(code_channels, 5, 5)'}), '(dim=1, unflattened_size=(code_channels, 5, 5))\n', (1160, 1207), True, 'import torch.nn as nn\n'), ((1447, 1557), 'model.backbone.conv.conv_block', 'conv_block', (['in_channels', 'in_channels'], {'... |
"""
Clean all Docker containers, volumes etc. from using the Docker backend.
"""
import click
from dcos_e2e_cli._vendor import vertigo_py
from dcos_e2e_cli.common.options import verbosity_option
from dcos_e2e_cli.dcos_vagrant.commands.destroy import destroy_cluster
from ._common import vm_names_by_cluster
@click.c... | [
"dcos_e2e_cli._vendor.vertigo_py.VM",
"click.option",
"dcos_e2e_cli.dcos_vagrant.commands.destroy.destroy_cluster",
"click.command"
] | [((313, 335), 'click.command', 'click.command', (['"""clean"""'], {}), "('clean')\n", (326, 335), False, 'import click\n'), ((337, 465), 'click.option', 'click.option', (['"""--destroy-running-clusters"""'], {'is_flag': '(True)', 'default': '(False)', 'show_default': '(True)', 'help': '"""Destroy running clusters."""'}... |
from __future__ import division, print_function
import pickle
import pdb
import os
import time
from sklearn.cross_validation import StratifiedKFold
from sklearn import svm
from sklearn import metrics
import gensim
import random
from learners import SK_SVM,SK_KNN,SK_MLP
from tuner import DE_Tune_ML
from model import Pap... | [
"numpy.random.seed",
"numpy.random.random_sample",
"sklearn.metrics.v_measure_score",
"sklearn.metrics.classification_report",
"os.path.isfile",
"pickle.load",
"numpy.mean",
"sklearn.neural_network.MLPClassifier",
"sklearn.svm.SVC",
"multiprocessing.Queue",
"sklearn.metrics.adjusted_rand_score",... | [((1916, 1950), 'os.path.sep.join', 'os.path.sep.join', (["['20171103.txt']"], {}), "(['20171103.txt'])\n", (1932, 1950), False, 'import os\n'), ((2141, 2175), 'results.results_process.reports', 'results_process.reports', (['file_name'], {}), '(file_name)\n', (2164, 2175), False, 'from results import results_process\n'... |
def transform_scalars(dataset):
"""
Normalize tilt series so that each tilt image has the same total intensity.
"""
from tomviz import utils
import numpy as np
data = utils.get_array(dataset) # Get data as numpy array
if data is None: # Check if data exists
raise RuntimeError("No ... | [
"numpy.average",
"tomviz.utils.get_array",
"numpy.sum",
"tomviz.utils.set_array"
] | [((193, 217), 'tomviz.utils.get_array', 'utils.get_array', (['dataset'], {}), '(dataset)\n', (208, 217), False, 'from tomviz import utils\n'), ((662, 692), 'tomviz.utils.set_array', 'utils.set_array', (['dataset', 'data'], {}), '(dataset, data)\n', (677, 692), False, 'from tomviz import utils\n'), ((486, 505), 'numpy.a... |
from digi.xbee.devices import DigiPointDevice, RemoteDigiPointDevice, XBee64BitAddress
#transmitting XBee should be in coordinader mode
#should be set to API mode aswell
#reciever should be in router mode
#can be either API or AT depending on if using XTCU or python API
#make sure to scan for device, using portsc... | [
"digi.xbee.devices.DigiPointDevice",
"digi.xbee.devices.XBee64BitAddress.from_hex_string"
] | [((368, 405), 'digi.xbee.devices.DigiPointDevice', 'DigiPointDevice', (['"""/dev/serial0"""', '(9600)'], {}), "('/dev/serial0', 9600)\n", (383, 405), False, 'from digi.xbee.devices import DigiPointDevice, RemoteDigiPointDevice, XBee64BitAddress\n'), ((467, 517), 'digi.xbee.devices.XBee64BitAddress.from_hex_string', 'XB... |
import imp
import inspect
import os
import sys
import uuid
from conans.client.generators import registered_generators
from conans.client.loader_txt import ConanFileTextLoader
from conans.client.tools.files import chdir
from conans.errors import ConanException, NotFoundException
from conans.model.conan_file import Cona... | [
"sys.path.pop",
"conans.errors.NotFoundException",
"conans.client.tools.files.chdir",
"conans.model.ref.ConanFileReference.loads",
"inspect.isclass",
"os.path.dirname",
"conans.client.loader_txt.ConanFileTextLoader",
"conans.model.options.OptionsValues.loads",
"os.path.exists",
"traceback.format_e... | [((10629, 10661), 'os.path.dirname', 'os.path.dirname', (['conan_file_path'], {}), '(conan_file_path)\n', (10644, 10661), False, 'import os\n'), ((10666, 10697), 'sys.path.insert', 'sys.path.insert', (['(0)', 'current_dir'], {}), '(0, current_dir)\n', (10681, 10697), False, 'import sys\n'), ((2698, 2766), 'conans.model... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from matplotlib import pyplot as plt
from torch import nn as nn
from torch.nn import fun... | [
"torch.ones_like",
"torch.relu",
"torch.zeros_like",
"torch.sqrt",
"torch.norm",
"torch.nn.Conv2d",
"numpy.zeros",
"torch.FloatTensor",
"torch.clamp",
"numpy.array",
"torch.nn.functional.max_pool2d",
"torch.max",
"torch.device",
"torch.min",
"matplotlib.pyplot.subplots",
"torch.round",... | [((752, 800), 'numpy.zeros', 'np.zeros', (['(ks * ks, 1, ks, ks)'], {'dtype': 'np.float32'}), '((ks * ks, 1, ks, ks), dtype=np.float32)\n', (760, 800), True, 'import numpy as np\n'), ((2026, 2045), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (2038, 2045), False, 'import torch\n'), ((2491, 2538), '... |
#!/usr/bin/env python
from __future__ import print_function
def analyze_match_table(path):
# Extract the instruction table.
data = open(path).read()
start = data.index("static const MatchEntry MatchTable")
end = data.index("\n};\n", start)
lines = data[start:end].split("\n")[1:]
# Parse the i... | [
"lit.Util.capture",
"os.path.join"
] | [((1851, 1889), 'lit.Util.capture', 'capture', (["['llvm-config', '--obj-root']"], {}), "(['llvm-config', '--obj-root'])\n", (1858, 1889), False, 'from lit.Util import capture\n'), ((1905, 1971), 'os.path.join', 'os.path.join', (['llvm_obj_root', '"""lib/Target/ARM/ARMGenAsmMatcher.inc"""'], {}), "(llvm_obj_root, 'lib/... |
import pytest
from unittest import TestCase
from pyflamegpu import *
import random as rand
TEST_LEN = 256
INT8_MAX = 127
INT16_MAX = 32767
INT32_MAX = 2147483647
INT64_MAX = 9223372036854775807
class step_func_max(pyflamegpu.HostFunctionCallback):
def __init__(self, Type, variable):
super().__init__... | [
"random.seed",
"random.randint"
] | [((1305, 1316), 'random.seed', 'rand.seed', ([], {}), '()\n', (1314, 1316), True, 'import random as rand\n'), ((1433, 1459), 'random.randint', 'rand.randint', (['(0)', 'range_max'], {}), '(0, range_max)\n', (1445, 1459), True, 'import random as rand\n')] |
#
# JiWER - Jitsi Word Error Rate
#
# Copyright @ 2018 - present 8x8, Inc.
#
# 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 requir... | [
"jiwer.transforms.Strip",
"jiwer.transforms.SentencesToListOfWords",
"jiwer.transforms.RemoveMultipleSpaces",
"jiwer.transforms.RemoveSpecificWords",
"Levenshtein.editops",
"jiwer.transforms.RemoveKaldiNonWords",
"jiwer.transforms.RemoveWhiteSpace",
"jiwer.transforms.ToLowerCase",
"jiwer.transforms.... | [((10573, 10627), 'Levenshtein.editops', 'Levenshtein.editops', (['source_string', 'destination_string'], {}), '(source_string, destination_string)\n', (10592, 10627), False, 'import Levenshtein\n'), ((11047, 11101), 'Levenshtein.editops', 'Levenshtein.editops', (['source_string', 'destination_string'], {}), '(source_s... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 law o... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.descriptor.FileDescriptor"
] | [((1000, 1026), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (1024, 1026), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1042, 1883), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""google/api/loggin... |
#!/usr/bin/env python
##############################################################################
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
################################... | [
"utils.utilities.setRunStatus",
"utils.utilities.getRunStatus",
"json.load",
"os.path.basename",
"shlex.split",
"json.dumps",
"time.sleep",
"shutil.copyfile",
"utils.custom_logger.getLogger",
"os.path.join",
"re.compile"
] | [((4308, 4322), 'time.sleep', 'time.sleep', (['(20)'], {}), '(20)\n', (4318, 4322), False, 'import time\n'), ((4866, 4880), 'utils.utilities.getRunStatus', 'getRunStatus', ([], {}), '()\n', (4878, 4880), False, 'from utils.utilities import getRunStatus, setRunStatus\n'), ((4933, 4970), 'utils.utilities.setRunStatus', '... |
"""
Copyright (c) 2021, NVIDIA CORPORATION.
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 law or agreed to in ... | [
"tensorflow.nn.compute_average_loss",
"argparse.ArgumentParser",
"tensorflow.keras.layers.Dense",
"horovod.tensorflow.size",
"sparse_operation_kit.OptimizerScope",
"tensorflow.reshape",
"utils.get_dense_optimizer",
"sparse_operation_kit.Init",
"sparse_operation_kit.Saver",
"sys.path.append",
"ho... | [((622, 650), 'sys.path.append', 'sys.path.append', (['"""../../../"""'], {}), "('../../../')\n", (637, 650), False, 'import sys\n'), ((6704, 6739), 'horovod.tensorflow.broadcast', 'hvd.broadcast', (['samples'], {'root_rank': '(0)'}), '(samples, root_rank=0)\n', (6717, 6739), True, 'import horovod.tensorflow as hvd\n')... |
# Copyright 2015 Google 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
#
# Unless required by applicable law or a... | [
"tensorflow.nn.relu",
"tensorflow.nn.max_pool3d",
"tensorflow.device",
"tensorflow.variable_scope",
"tensorflow.add_to_collection",
"tensorflow.nn.conv3d",
"tensorflow.placeholder",
"tensorflow.matmul",
"tensorflow.nn.l2_loss",
"tensorflow.truncated_normal_initializer",
"tensorflow.nn.dropout",
... | [((4302, 4430), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '(self.BATCH_SIZE, self.NUM_FRAMES_PER_CLIP, self.CROP_SIZE, self.CROP_SIZE,\n self.CHANNELS)'}), '(tf.float32, shape=(self.BATCH_SIZE, self.NUM_FRAMES_PER_CLIP,\n self.CROP_SIZE, self.CROP_SIZE, self.CHANNELS))\n', (4316, 4430... |
import pytest
from packaging import version
import qcodes as qc
from numpy.testing import assert_array_equal
from plottr.data.datadict import DataDict
from plottr.node.tools import linearFlowchart
from plottr.data.qcodes_dataset import QCodesDSLoader
from plottr.node.data_selector import DataSelector
from plottr.node... | [
"packaging.version.parse",
"plottr.node.tools.linearFlowchart"
] | [((635, 773), 'plottr.node.tools.linearFlowchart', 'linearFlowchart', (["('Data loader', QCodesDSLoader)", "('Data selection', DataSelector)", "('Grid', DataGridder)", "('Scale Units', ScaleUnits)"], {}), "(('Data loader', QCodesDSLoader), ('Data selection',\n DataSelector), ('Grid', DataGridder), ('Scale Units', Sc... |
from setuptools import setup
setup(
name = 'aiohttp_dynamic',
packages = ['aiohttp_dynamic'],
version = '1.3.0',
license='Apache License 2.0',
description = 'aiohttp extension for creating and modifying dynamic routes in runtime',
author = 'bitrate16',
author_email = '<EMAIL>',
url = 'https://github.com/bitrat... | [
"setuptools.setup"
] | [((30, 1073), 'setuptools.setup', 'setup', ([], {'name': '"""aiohttp_dynamic"""', 'packages': "['aiohttp_dynamic']", 'version': '"""1.3.0"""', 'license': '"""Apache License 2.0"""', 'description': '"""aiohttp extension for creating and modifying dynamic routes in runtime"""', 'author': '"""bitrate16"""', 'author_email'... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-17 18:40
import json
from django.db import migrations
def reset_actions_and_quests(apps, schema_editor):
for hero in apps.get_model("heroes", "Hero").objects.all():
actions = json.loads(hero.actions)
actions['actions'] = [actions[... | [
"django.db.migrations.RunPython",
"json.loads",
"json.dumps"
] | [((256, 280), 'json.loads', 'json.loads', (['hero.actions'], {}), '(hero.actions)\n', (266, 280), False, 'import json\n'), ((359, 398), 'json.dumps', 'json.dumps', (['actions'], {'ensure_ascii': '(False)'}), '(actions, ensure_ascii=False)\n', (369, 398), False, 'import json\n'), ((573, 619), 'django.db.migrations.RunPy... |
from django.contrib import admin
from .models import Setting, Profile, Inbox, Dislike, Match, UserPhoto, Like
admin.site.register(Like)
admin.site.register(Inbox)
admin.site.register(Match)
admin.site.register(UserPhoto)
admin.site.register(Setting)
admin.site.register(Dislike)
admin.site.register(Profile)
# Register... | [
"django.contrib.admin.site.register"
] | [((111, 136), 'django.contrib.admin.site.register', 'admin.site.register', (['Like'], {}), '(Like)\n', (130, 136), False, 'from django.contrib import admin\n'), ((137, 163), 'django.contrib.admin.site.register', 'admin.site.register', (['Inbox'], {}), '(Inbox)\n', (156, 163), False, 'from django.contrib import admin\n'... |
import math
import numpy as np
import re
class bitstream:
def __init__(self,array = None):
if(str(locals()['array']) == 'None'):
self.array_unit_size = 8
self.array_type = 'uint'
self.valid = True
self.read_index = 0
self.r_bit_... | [
"math.log",
"numpy.zeros",
"math.ceil"
] | [((11166, 11209), 'math.ceil', 'math.ceil', (['(self.size / self.array_unit_size)'], {}), '(self.size / self.array_unit_size)\n', (11175, 11209), False, 'import math\n'), ((438, 464), 'numpy.zeros', 'np.zeros', (['(8)'], {'dtype': '"""uint8"""'}), "(8, dtype='uint8')\n", (446, 464), True, 'import numpy as np\n'), ((144... |
import datetime
import pytz
from django.test import SimpleTestCase
from .schedules import repeater, every_day_at, every_dow_at
DENVER = pytz.timezone('America/Denver')
def tztime(tz, *args, **kwargs):
if not isinstance(tz, datetime.tzinfo):
tz = pytz.timezone(tz)
naive = datetime.datetime(*args, *... | [
"pytz.FixedOffset",
"datetime.datetime",
"datetime.timedelta",
"pytz.timezone",
"datetime.time"
] | [((140, 171), 'pytz.timezone', 'pytz.timezone', (['"""America/Denver"""'], {}), "('America/Denver')\n", (153, 171), False, 'import pytz\n'), ((294, 328), 'datetime.datetime', 'datetime.datetime', (['*args'], {}), '(*args, **kwargs)\n', (311, 328), False, 'import datetime\n'), ((264, 281), 'pytz.timezone', 'pytz.timezon... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# * * * * * * * * * * * * * * * * * * * *
# pokeyproxy: a simple TCP proxy
# Requires python3
#
# Help & Usage:
# $ python3 pokeyproxy.py -h
#
# * * * * * * * * * * * * * * * * * * * *
#
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby gr... | [
"threading.Thread",
"argparse.ArgumentParser",
"socket.socket",
"signal.getsignal",
"signal.signal",
"sys.exit"
] | [((1677, 1702), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1700, 1702), False, 'import argparse\n'), ((5111, 5160), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (5124, 5160), False, 'import socket\n'), ((6715, 6... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from functools import partial
from itertools import chain, takewhile
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
from .comparison import ExpressionMatcher
from .compat import mock
from .utils import... | [
"functools.partial",
"itertools.chain"
] | [((16429, 16506), 'itertools.chain', 'chain', (['*[result for calls, result in sorted_mock_data if query_call in calls]'], {}), '(*[result for calls, result in sorted_mock_data if query_call in calls])\n', (16434, 16506), False, 'from itertools import chain, takewhile\n'), ((12970, 13007), 'functools.partial', 'partial... |
import embedtemplates
import permissions
async def Main(self, message, command, arguments):
if arguments == "" or arguments is None or arguments == command:
await message.channel.send(content="", embed=embedtemplates.help("Removes a Rank from the server."))
return
if not await permissions.is_g... | [
"permissions.is_guild_admin",
"embedtemplates.failure",
"embedtemplates.help"
] | [((304, 373), 'permissions.is_guild_admin', 'permissions.is_guild_admin', (['self', 'message.guild.id', 'message.author.id'], {}), '(self, message.guild.id, message.author.id)\n', (330, 373), False, 'import permissions\n'), ((216, 270), 'embedtemplates.help', 'embedtemplates.help', (['"""Removes a Rank from the server.... |
import sys
import csv
import time
import cvxopt
import numpy as np
import pandas as pd
from svmutil import *
import matplotlib.pyplot as plt
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
# reading data from csv files
def get_data(data_path,issubset,digit1,digit2):
train_data = np.a... | [
"matplotlib.pyplot.title",
"numpy.ravel",
"numpy.argmax",
"pandas.read_csv",
"numpy.ones",
"numpy.exp",
"numpy.multiply",
"matplotlib.pyplot.imshow",
"numpy.savetxt",
"numpy.identity",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.set_cmap",
"cvxopt.solvers.qp",
"matplotlib.pyplot.show"... | [((396, 428), 'numpy.array', 'np.array', (['train_data[:, 784:785]'], {}), '(train_data[:, 784:785])\n', (404, 428), True, 'import numpy as np\n'), ((951, 972), 'matplotlib.pyplot.imshow', 'plt.imshow', (['confatrix'], {}), '(confatrix)\n', (961, 972), True, 'import matplotlib.pyplot as plt\n'), ((974, 1003), 'matplotl... |
#
# Copyright (C) 2016-2020 by <NAME>, <NAME>, <NAME>, and contributors
#
# This file is part of Power Sequencer.
#
# Power Sequencer 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
# Lic... | [
"bpy.props.BoolProperty",
"bpy.ops.sequencer.effect_strip_add",
"bpy.props.FloatProperty"
] | [((1882, 2002), 'bpy.props.FloatProperty', 'bpy.props.FloatProperty', ([], {'name': '"""Crossfade Duration"""', 'description': '"""The duration of the crossfade"""', 'default': '(0.5)', 'min': '(0)'}), "(name='Crossfade Duration', description=\n 'The duration of the crossfade', default=0.5, min=0)\n", (1905, 2002), ... |
# -*- coding:utf-8 -*-
import logging
import subprocess
from time import gmtime, strftime
import datetime
from apscheduler.schedulers.blocking import BlockingScheduler
def clear():
command = "python clear.py"
subprocess.call(command.split())
def once():
command = "python once.py"
subprocess.c... | [
"logging.basicConfig",
"apscheduler.schedulers.blocking.BlockingScheduler"
] | [((458, 497), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (477, 497), False, 'import logging\n'), ((510, 529), 'apscheduler.schedulers.blocking.BlockingScheduler', 'BlockingScheduler', ([], {}), '()\n', (527, 529), False, 'from apscheduler.schedulers.blocking... |
import os
import io
import csv
import ast
import sys
import math
import struct
from enum import Enum
from exceptions import CSVError, SchemaError
csv.field_size_limit(sys.maxsize) # Don't limit the size of user input fields.
class Type(Enum):
UNKNOWN = 0
BOOL = 1
DOUBLE = 2
FLOAT = 2 # alias to... | [
"exceptions.SchemaError",
"math.isnan",
"math.isinf",
"csv.reader",
"os.path.basename",
"csv.field_size_limit",
"struct.pack",
"io.open",
"ast.literal_eval"
] | [((147, 180), 'csv.field_size_limit', 'csv.field_size_limit', (['sys.maxsize'], {}), '(sys.maxsize)\n', (167, 180), False, 'import csv\n'), ((1152, 1178), 'ast.literal_eval', 'ast.literal_eval', (['prop_val'], {}), '(prop_val)\n', (1168, 1178), False, 'import ast\n'), ((5883, 5938), 'struct.pack', 'struct.pack', (['for... |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
'''Correction for gaseous absorption based on SMAC method (Rahman and Dedieu, 1994)
'''
from math import *
import numpy as np
# =============================================================================================
def PdeZ(Z):
"""
PdeZ : Atmospher... | [
"numpy.exp"
] | [((8207, 8225), 'numpy.exp', 'np.exp', (['(-taup / us)'], {}), '(-taup / us)\n', (8213, 8225), True, 'import numpy as np\n'), ((14032, 14050), 'numpy.exp', 'np.exp', (['(-taup / us)'], {}), '(-taup / us)\n', (14038, 14050), True, 'import numpy as np\n'), ((8722, 8741), 'numpy.exp', 'np.exp', (['(-taup / aa1)'], {}), '(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Copyright 2018 Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | [
"ansible.module_utils.basic.AnsibleModule",
"base64.b64decode",
"pandevice.network.VirtualRouter",
"pandevice.network.BgpPolicyConditionalAdvertisement"
] | [((5318, 5437), 'ansible.module_utils.basic.AnsibleModule', 'AnsibleModule', ([], {'argument_spec': 'helper.argument_spec', 'supports_check_mode': '(True)', 'required_one_of': 'helper.required_one_of'}), '(argument_spec=helper.argument_spec, supports_check_mode=True,\n required_one_of=helper.required_one_of)\n', (53... |
#!/usr/bin/env python
######################################################################################
## Copyright (c) 2010-2011 The Department of Arts and Culture, ##
## The Government of the Republic of South Africa. ##
## ... | [
"speect.modules.rewrites.RewriteRule"
] | [((4463, 4500), 'speect.modules.rewrites.RewriteRule', 'rewrites.RewriteRule', (['LC', 'G', 'RC', 'P', '(0)'], {}), '(LC, G, RC, P, 0)\n', (4483, 4500), True, 'import speect.modules.rewrites as rewrites\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
setup(
name='flake8-pytest-mark',
version='1.0.0',
description='A flake8 plugin t... | [
"setuptools.setup"
] | [((227, 1365), 'setuptools.setup', 'setup', ([], {'name': '"""flake8-pytest-mark"""', 'version': '"""1.0.0"""', 'description': '"""A flake8 plugin that helps check the presence of a PyTest mark"""', 'long_description': "(readme + '\\n\\n' + history)", 'author': '"""rpc-automation"""', 'author_email': '"""<EMAIL>"""', '... |
import re
import requests
import os
import json
import zipfile
import files
# load config file
config = None
with open("bundler.json") as f:
config = json.load(f)
OUTPUT_DIR = "lib"
GITHUB_API = "https://api.github.com/"
if not os.path.exists(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
for package in config:
... | [
"os.remove",
"json.load",
"zipfile.ZipFile",
"os.makedirs",
"os.path.exists",
"files.download_file",
"re.match"
] | [((156, 168), 'json.load', 'json.load', (['f'], {}), '(f)\n', (165, 168), False, 'import json\n'), ((236, 262), 'os.path.exists', 'os.path.exists', (['OUTPUT_DIR'], {}), '(OUTPUT_DIR)\n', (250, 262), False, 'import os\n'), ((268, 291), 'os.makedirs', 'os.makedirs', (['OUTPUT_DIR'], {}), '(OUTPUT_DIR)\n', (279, 291), Fa... |
from django.db import models
class Company(models.Model):
name = models.CharField(blank=True, max_length=300)
ticker = models.CharField(blank=True, max_length=300)
def __str__(self):
return f"({self.ticker}) {self.name}" | [
"django.db.models.CharField"
] | [((71, 115), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(300)'}), '(blank=True, max_length=300)\n', (87, 115), False, 'from django.db import models\n'), ((129, 173), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(300)'}), '(blank... |
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must reta... | [
"re.sub",
"re.match"
] | [((1737, 1761), 're.match', 're.match', (['"""^\\\\s*$"""', 'line'], {}), "('^\\\\s*$', line)\n", (1745, 1761), False, 'import re\n'), ((2435, 2471), 're.sub', 're.sub', (['"""^(\\\\s*)<.+> """', '"""\x01"""', 'line'], {}), "('^(\\\\s*)<.+> ', '\\x01', line)\n", (2441, 2471), False, 'import re\n')] |
#!/usr/bin/env python
import json
import os
import sys
import glob
from cloudpickle import dumps, loads
import numpy as np
import dask.array as da
import dask.dataframe as ddf
import argparse
from random import randint
from pathlib import Path
from dask_ml.wrappers import ParallelPostFit
from dask_ml.ensemble impor... | [
"json.load",
"sklearn.ensemble.HistGradientBoostingClassifier",
"argparse.ArgumentParser",
"random.randint",
"cloudpickle.dumps",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.balanced_accuracy_score",
"sklearn.metrics.recall_score",
"pathlib.Path",
"sklearn.metrics.f1_score",
"dask.array.c... | [((432, 447), 'sklearnex.patch_sklearn', 'patch_sklearn', ([], {}), '()\n', (445, 447), False, 'from sklearnex import patch_sklearn\n'), ((1377, 1421), 'glob.iglob', 'glob.iglob', (["(prefix + '**/**')"], {'recursive': '(True)'}), "(prefix + '**/**', recursive=True)\n", (1387, 1421), False, 'import glob\n'), ((1591, 16... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | [
"pandas.DataFrame",
"copy.deepcopy",
"traceback.format_exception",
"os.path.abspath",
"qiskit_metal.logger.error",
"traceback.extract_stack",
"pandas.Series",
"sys.exc_info",
"traceback.format_list",
"re.sub",
"os.access"
] | [((4319, 4333), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (4331, 4333), True, 'import pandas as pd\n'), ((4880, 4913), 're.sub', 're.sub', (['"""\\\\W|^(?=\\\\d)"""', '"""_"""', 'text'], {}), "('\\\\W|^(?=\\\\d)', '_', text)\n", (4886, 4913), False, 'import re\n'), ((5600, 5625), 'traceback.extract_stack', ... |
#########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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... | [
"aria.orchestrator.workflows.core.engine.Engine",
"manager_rest.rest.rest_utils.get_json_and_verify_params",
"aria.orchestrator.workflows.executor.process.ProcessExecutor",
"aria.orchestrator.execution_preparer.ExecutionPreparer"
] | [((1425, 1463), 'manager_rest.rest.rest_utils.get_json_and_verify_params', 'get_json_and_verify_params', (["{'action'}"], {}), "({'action'})\n", (1451, 1463), False, 'from manager_rest.rest.rest_utils import get_json_and_verify_params\n'), ((3232, 3291), 'aria.orchestrator.workflows.executor.process.ProcessExecutor', '... |
import numpy as np
import tensorflow as tf
import math
import os
import glob
import scipy.io
#=======================================================================================================================
#Helper functions to load pretrained weights
#=========================================================... | [
"numpy.load",
"os.path.basename",
"numpy.transpose",
"tensorflow.variable_scope",
"tensorflow.transpose",
"tensorflow.matmul",
"os.path.join",
"tensorflow.get_variable"
] | [((2376, 2410), 'tensorflow.transpose', 'tf.transpose', (['tensor', '[0, 2, 1, 3]'], {}), '(tensor, [0, 2, 1, 3])\n', (2388, 2410), True, 'import tensorflow as tf\n'), ((2497, 2534), 'tensorflow.transpose', 'tf.transpose', (['tensor', '[0, 2, 1, 3, 4]'], {}), '(tensor, [0, 2, 1, 3, 4])\n', (2509, 2534), True, 'import t... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import numpy as np
import matplotlib.py... | [
"matplotlib.pyplot.title",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Dense",
"tensorflow.compat.v1.disable_eager_execution",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"os.path.join",
"tensorflow.ker... | [((335, 373), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (371, 373), True, 'import tensorflow as tf\n'), ((721, 792), 'tensorflow.keras.utils.get_file', 'tf.keras.utils.get_file', (['"""cats_and_dogs.zip"""'], {'origin': '_URL', 'extract': '(True)'}), "('ca... |
# Copyright 2019 <NAME>
#
# 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 law or agreed to in writing, softw... | [
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.leaky_relu",
"torch.nn.Linear"
] | [((1283, 1315), 'torch.nn.Linear', 'nn.Linear', (['(inputs * 4 * 4)', 'zsize'], {}), '(inputs * 4 * 4, zsize)\n', (1292, 1315), False, 'from torch import nn\n'), ((1388, 1420), 'torch.nn.Linear', 'nn.Linear', (['zsize', '(inputs * 4 * 4)'], {}), '(zsize, inputs * 4 * 4)\n', (1397, 1420), False, 'from torch import nn\n'... |
import copy
import pytest
import numpy as np
from cotk.dataloader import LanguageGeneration, MSCOCO
from cotk.metric import MetricBase
from cotk.wordvector.wordvector import WordVector
from cotk.wordvector.gloves import Glove
import logging
def setup_module():
import random
random.seed(0)
import numpy as np
np.ra... | [
"numpy.random.seed",
"cotk.wordvector.wordvector.WordVector.load_class",
"pytest.raises",
"cotk.wordvector.wordvector.WordVector.get_all_subclasses",
"random.seed",
"cotk.wordvector.gloves.Glove",
"cotk.wordvector.wordvector.WordVector.load"
] | [((279, 293), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (290, 293), False, 'import random\n'), ((315, 332), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (329, 332), True, 'import numpy as np\n'), ((497, 528), 'cotk.wordvector.wordvector.WordVector.get_all_subclasses', 'WordVector.get_all_s... |
#!/usr/bin/env python
import inspect
import time
import kottos
import kottos.modbus
from kottos.modbus.client import Client
from kottos.modbus.registers import MNS_REGISTER_TABLE
c = Client("192.168.1.90", 502, MNS_REGISTER_TABLE)
i = 0
while i < 10:
results = c.scan()
for (k, v) in results.items():
... | [
"kottos.modbus.client.Client",
"time.sleep"
] | [((184, 231), 'kottos.modbus.client.Client', 'Client', (['"""192.168.1.90"""', '(502)', 'MNS_REGISTER_TABLE'], {}), "('192.168.1.90', 502, MNS_REGISTER_TABLE)\n", (190, 231), False, 'from kottos.modbus.client import Client\n'), ((354, 367), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (364, 367), False, 'import ... |
#!/usr/bin/env python
# ---------------------------------------------------------
# IOU Tracker
# Copyright (c) 2017 TU Berlin, Communication Systems Group
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# ---------------------------------------------------------
from time import time
i... | [
"util.save_to_csv",
"argparse.ArgumentParser",
"time.time",
"iou_tracker.track_iou",
"util.load_mot"
] | [((1821, 1953), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""IOU Tracker MOT17 demo script. The best parameters for each detector are hardcoded."""'}), "(description=\n 'IOU Tracker MOT17 demo script. The best parameters for each detector are hardcoded.'\n )\n", (1844, 1953), Fal... |
#!/usr/bin/env python
# This software was developed at the National Institute of Standards
# and Technology by employees of the Federal Government in the course
# of their official duties. Pursuant to title 17 Section 105 of the
# United States Code this software is not subject to copyright
# protection and is in the ... | [
"Objects.iterparse",
"argparse.ArgumentParser",
"logging.basicConfig",
"os.path.basename"
] | [((664, 690), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (680, 690), False, 'import os\n'), ((770, 802), 'Objects.iterparse', 'Objects.iterparse', (['args.in_dfxml'], {}), '(args.in_dfxml)\n', (787, 802), False, 'import Objects\n'), ((1569, 1594), 'argparse.ArgumentParser', 'argparse.Ar... |
import asyncio
from typing import Any
from typing import AsyncGenerator
from typing import Callable
from typing import Dict
from typing import List
import gidgethub
from gidgethub.aiohttp import GitHubAPI
# List of mutually exclusive status labels
ISSUE_STATUS_LABELS = {
"needs_reviewer",
"awaiting_reviewer",... | [
"asyncio.sleep"
] | [((874, 901), 'asyncio.sleep', 'asyncio.sleep', (['wait_seconds'], {}), '(wait_seconds)\n', (887, 901), False, 'import asyncio\n')] |
import datetime
import pytest
from deploy.pretty_printing import pprint_date
@pytest.mark.parametrize("date_obj, now, expected_str", [
("2020-01-01 12:00:00", "2020-01-01 12:00:01", "just now"),
("2020-01-01 12:00:00", "2020-01-01 12:02:00", "just now"),
("2020-01-01 12:00:00", "2020-01-01 12:02:02", "t... | [
"pytest.mark.parametrize",
"datetime.datetime.strptime",
"deploy.pretty_printing.pprint_date"
] | [((82, 841), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""date_obj, now, expected_str"""', "[('2020-01-01 12:00:00', '2020-01-01 12:00:01', 'just now'), (\n '2020-01-01 12:00:00', '2020-01-01 12:02:00', 'just now'), (\n '2020-01-01 12:00:00', '2020-01-01 12:02:02',\n 'today @ 12:00 (2 min ago)')... |
#
# mongotools: Database Migration Utility
# Author: <NAME>
#
import sys
from importdb import import_all
from exportdb import export_all
from config import CONFIG
if len(sys.argv) < 2:
print("USAGE: python mongotools.py option[import,export]")
sys.exit(0)
option = sys.argv[1]
if option == 'import':
prin... | [
"importdb.import_all",
"exportdb.export_all",
"sys.exit"
] | [((254, 265), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (262, 265), False, 'import sys\n'), ((381, 393), 'importdb.import_all', 'import_all', ([], {}), '()\n', (391, 393), False, 'from importdb import import_all\n'), ((486, 498), 'exportdb.export_all', 'export_all', ([], {}), '()\n', (496, 498), False, 'from expo... |
"""
Main test configuration, used to fix fixture loading
"""
import pytest
from pytest_ansible_docker import AnsibleDockerTestinfraBackend
@pytest.fixture
def TestinfraBackend(request):
"""
Entry point to boot and stop a docker image.
"""
return AnsibleDockerTestinfraBackend(request)
| [
"pytest_ansible_docker.AnsibleDockerTestinfraBackend"
] | [((267, 305), 'pytest_ansible_docker.AnsibleDockerTestinfraBackend', 'AnsibleDockerTestinfraBackend', (['request'], {}), '(request)\n', (296, 305), False, 'from pytest_ansible_docker import AnsibleDockerTestinfraBackend\n')] |
"""
CEASIOMpy: Conceptual Aircraft Design Software.
Developed for CFS ENGINEERING, 1015 Lausanne, Switzerland
Functions to create the dictionnary of geometric variables needed
for the optimnization routine.
Python version: >=3.6
| Author : <NAME>
| Creation: 2020-03-24
| Last modification: 2020-06-02
TODO
----
... | [
"ceasiompy.utils.apmfunctions.get_aeromap",
"ceasiompy.CPACSUpdater.cpacsupdater.get_aircraft",
"ceasiompy.utils.cpacsfunctions.open_tigl",
"sys.exit",
"numpy.repeat"
] | [((2873, 2908), 'ceasiompy.utils.apmfunctions.get_aeromap', 'apmf.get_aeromap', (['tixi', 'aeromap_uid'], {}), '(tixi, aeromap_uid)\n', (2889, 2908), True, 'import ceasiompy.utils.apmfunctions as apmf\n'), ((10398, 10418), 'ceasiompy.utils.cpacsfunctions.open_tigl', 'cpsf.open_tigl', (['tixi'], {}), '(tixi)\n', (10412,... |
OntCversion = '2.0.0'
from ontology.builtins import print
from ontology.libont import bytes2hexstring, hexstring2bytes, elt_in
def VaasAssert(expr):
if not expr:
raise Exception("AssertError")
def Main():
a = b'\x01\xef\xab\xcd\x23\x45\xff\xfe\xef\xed\xdc\xba\xa9\xf9\xe9\x9a\x9f\x9e\x99\x8e\x00\x01\x0... | [
"ontology.libont.bytes2hexstring",
"ontology.libont.hexstring2bytes",
"ontology.builtins.print"
] | [((365, 386), 'ontology.libont.bytes2hexstring', 'bytes2hexstring', (['a', '(1)'], {}), '(a, 1)\n', (380, 386), False, 'from ontology.libont import bytes2hexstring, hexstring2bytes, elt_in\n'), ((491, 511), 'ontology.libont.hexstring2bytes', 'hexstring2bytes', (['res'], {}), '(res)\n', (506, 511), False, 'from ontology... |
from typing import Tuple
from PyQt5 import QtCore, QtOpenGL, QtWidgets, QtGui
from moderngl_window.context.base import BaseWindow
from moderngl_window.context.pyqt5.keys import Keys
class Window(BaseWindow):
"""
A basic window implementation using PyQt5 with the goal of
creating an OpenGL conte... | [
"PyQt5.QtGui.QIcon",
"PyQt5.QtWidgets.QSizePolicy",
"PyQt5.QtCore.QCoreApplication.instance",
"PyQt5.QtWidgets.QDesktopWidget",
"PyQt5.QtOpenGL.QGLWidget",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtOpenGL.QGLFormat"
] | [((1022, 1042), 'PyQt5.QtOpenGL.QGLFormat', 'QtOpenGL.QGLFormat', ([], {}), '()\n', (1040, 1042), False, 'from PyQt5 import QtCore, QtOpenGL, QtWidgets, QtGui\n'), ((1601, 1627), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['[]'], {}), '([])\n', (1623, 1627), False, 'from PyQt5 import QtCore, QtOpenGL, Q... |
from setuptools import setup
setup(name='perftool',
version='0.1.4',
description='The Performance Tool',
url='https://github.com/Yajan/Perftool.git',
author='Yajana',
author_email='<EMAIL>',
license='Apache License',
packages=['perftool','perftool.ext','perftool.reporter'],
... | [
"setuptools.setup"
] | [((30, 305), 'setuptools.setup', 'setup', ([], {'name': '"""perftool"""', 'version': '"""0.1.4"""', 'description': '"""The Performance Tool"""', 'url': '"""https://github.com/Yajan/Perftool.git"""', 'author': '"""Yajana"""', 'author_email': '"""<EMAIL>"""', 'license': '"""Apache License"""', 'packages': "['perftool', '... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.twcgi}.
"""
import sys
import os
import json
from io import BytesIO
from twisted.trial import unittest
from twisted.internet import address, reactor, interfaces, error
from twisted.internet.error import ConnectionLost... | [
"twisted.web.http_headers.Headers",
"twisted.internet.error.ConnectionLost",
"twisted.python.util.sibpath",
"twisted.web.client.readBody",
"twisted.web.twcgi.CGIProcessProtocol",
"twisted.web.test.requesthelper.DummyRequest",
"twisted.web.test.requesthelper.DummyChannel",
"twisted.web.server.Site",
... | [((2208, 2227), 'twisted.web.resource.Resource', 'resource.Resource', ([], {}), '()\n', (2225, 2227), False, 'from twisted.web import client, http, twcgi, server, resource, http_headers\n'), ((2246, 2273), 'twisted.python.util.sibpath', 'util.sibpath', (['__file__', 'cgi'], {}), '(__file__, cgi)\n', (2258, 2273), False... |
#copybot.py
import pyautogui as pg
import time
################## LINE 1 ###################
#-ใช้เมาส์คลิกไปยังตำแหน่งที่ต้องการก็อปปี้ (ด้านหน้า)
# x=1046, y=266
time.sleep(1) # รอ 1 วินาที
start_point = (1046,266)
pg.click(start_point)
#-ลากไปให้สุดบรรทัด
time.sleep(1)
end_point = (1400,266)
pg.dra... | [
"pyautogui.hotkey",
"pyautogui.press",
"pyautogui.dragTo",
"time.sleep",
"pyautogui.click"
] | [((174, 187), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (184, 187), False, 'import time\n'), ((229, 250), 'pyautogui.click', 'pg.click', (['start_point'], {}), '(start_point)\n', (237, 250), True, 'import pyautogui as pg\n'), ((275, 288), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (285, 288), False, ... |
# Copyright 2018 The CapsLayer 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 applicab... | [
"os.path.expanduser",
"numpy.random.seed",
"tensorflow.python_io.TFRecordWriter",
"os.makedirs",
"tensorflow.python.keras.utils.data_utils.get_file",
"os.path.exists",
"capslayer.data.utils.TFRecordHelper.bytes_feature",
"tensorflow.python.keras.datasets.cifar.load_batch",
"numpy.reshape",
"capsla... | [((3092, 3137), 'os.path.join', 'os.path.join', (['path', '"""train_cifar100.tfrecord"""'], {}), "(path, 'train_cifar100.tfrecord')\n", (3104, 3137), False, 'import os\n'), ((3161, 3205), 'os.path.join', 'os.path.join', (['path', '"""eval_cifar100.tfrecord"""'], {}), "(path, 'eval_cifar100.tfrecord')\n", (3173, 3205), ... |
import torch
# import torch.distributions as dist
import os
import shutil
import argparse
import torch.optim as optim
from tqdm import tqdm
import time
from collections import defaultdict
import pandas as pd
from src import config
from src.checkpoints import CheckpointIO
from src.utils.io import export_pointcloud
from ... | [
"pickle.dump",
"argparse.ArgumentParser",
"src.config.get_dataset",
"collections.defaultdict",
"torch.device",
"os.path.join",
"pandas.DataFrame",
"torch.utils.data.DataLoader",
"src.checkpoints.CheckpointIO",
"src.config.get_model",
"os.path.exists",
"shutil.copyfile",
"tqdm.tqdm",
"torch... | [((386, 463), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract meshes from occupancy process."""'}), "(description='Extract meshes from occupancy process.')\n", (409, 463), False, 'import argparse\n'), ((754, 809), 'src.config.load_config', 'config.load_config', (['args.config', '"... |
import torch
import numpy as np
import torch.nn as nn
from math import ceil
from torch.autograd import Variable
from ptsemseg import caffe_pb2
from ptsemseg.models.utils import *
from ptsemseg.loss import *
pspnet_specs = {
'pascalvoc':
{
'n_classes': 21,
'input_size': (473, 473),
... | [
"os.mkdir",
"torch.nn.Dropout2d",
"numpy.copy",
"numpy.argmax",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"numpy.zeros",
"ptsemseg.loader.cityscapes_loader.cityscapesLoader",
"os.path.exists",
"torch.cuda.device_count",
"ptsemseg.caffe_pb2.NetParameter",
"numpy.array",
"scipy.misc.imsave... | [((14241, 14266), 'ptsemseg.loader.cityscapes_loader.cityscapesLoader', 'cl', ([], {'root': 'dataset_root_dir'}), '(root=dataset_root_dir)\n', (14243, 14266), True, 'from ptsemseg.loader.cityscapes_loader import cityscapesLoader as cl\n'), ((14403, 14431), 'scipy.misc.imsave', 'm.imsave', (['"""cropped.png"""', 'img'],... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import doctest
import test
doctest.testmod(test, optionflags=doctest.NORMALIZE_WHITESPACE |
doctest.ELLIPSIS |
doctest.REPORT_ONLY_FIRST_FAILURE
)
| [
"doctest.testmod"
] | [((80, 203), 'doctest.testmod', 'doctest.testmod', (['test'], {'optionflags': '(doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS | doctest.\n REPORT_ONLY_FIRST_FAILURE)'}), '(test, optionflags=doctest.NORMALIZE_WHITESPACE | doctest.\n ELLIPSIS | doctest.REPORT_ONLY_FIRST_FAILURE)\n', (95, 203), False, 'import doct... |
import json
from requests import Response as RequestsResponse
from flask import Response as FlaskResponse
class Handler:
@staticmethod
def response(response: RequestsResponse) -> FlaskResponse:
try:
return FlaskResponse(response.text, response.status_code, headers=response.headers.items(... | [
"flask.Response",
"json.dumps"
] | [((373, 404), 'flask.Response', 'FlaskResponse', (["{'text': e}", '(500)'], {}), "({'text': e}, 500)\n", (386, 404), True, 'from flask import Response as FlaskResponse\n'), ((565, 584), 'json.dumps', 'json.dumps', (['object_'], {}), '(object_)\n', (575, 584), False, 'import json\n'), ((688, 749), 'flask.Response', 'Fla... |
#!/usr/bin/env python
# coding: utf-8
# In[8]:
import pandas as pd
from sklearn import tree
# In[9]:
df = pd.read_csv("E:\GIT\-CSE-0408-Summer-2021\Final\Decision\Tahmina.csv")
# In[10]:
x = df.iloc[:,:-1]
# In[11]:
x
# In[12]:
y=df.iloc[:,3]
# In[13]:
y
# In[14]:
classify_ = tree.DecisionTre... | [
"pandas.read_csv",
"sklearn.tree.DecisionTreeClassifier"
] | [((113, 188), 'pandas.read_csv', 'pd.read_csv', (['"""E:\\\\GIT\\\\-CSE-0408-Summer-2021\\\\Final\\\\Decision\\\\Tahmina.csv"""'], {}), "('E:\\\\GIT\\\\-CSE-0408-Summer-2021\\\\Final\\\\Decision\\\\Tahmina.csv')\n", (124, 188), True, 'import pandas as pd\n'), ((304, 333), 'sklearn.tree.DecisionTreeClassifier', 'tree.De... |
import random
from link import Link
from neuro import Neuro
class Network:
def __init__(self, *args):
self.__nlayers = len(args)
self.__neuros = args
self.__layers = []
for i in range(self.__nlayers):
self.__layers.append( [Neuro([],[]) for n in range(self.__neuros... | [
"random.random",
"neuro.Neuro"
] | [((279, 292), 'neuro.Neuro', 'Neuro', (['[]', '[]'], {}), '([], [])\n', (284, 292), False, 'from neuro import Neuro\n'), ((483, 498), 'random.random', 'random.random', ([], {}), '()\n', (496, 498), False, 'import random\n'), ((612, 627), 'random.random', 'random.random', ([], {}), '()\n', (625, 627), False, 'import ran... |
#---- Code Surveyor, Copyright 2020 <NAME>, MIT License
'''
Surveyor Job
Executes a measurement job against a folder tree, using jobworker processes
to read files and delegate measurement tasks to Surveyor modules.
'''
import os
import time
import multiprocessing
from queue import Empty, Full
from code_s... | [
"code_surveyor.framework.log.get_context",
"code_surveyor.framework.log.stack",
"code_surveyor.framework.log.cc",
"time.sleep",
"os.path.splitext",
"multiprocessing.Queue",
"os.path.join",
"multiprocessing.cpu_count"
] | [((755, 782), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (780, 782), False, 'import multiprocessing\n'), ((3109, 3132), 'multiprocessing.Queue', 'multiprocessing.Queue', ([], {}), '()\n', (3130, 3132), False, 'import multiprocessing\n'), ((3162, 3185), 'multiprocessing.Queue', 'multipro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tornado
from flask_script import Manager, Shell
from flask_migrate import Migrate, MigrateCommand
import logging
from logging.handlers import RotatingFileHandler
from tornado import options
from tornado.wsgi import WSGIContainer
from tornado.httpserver i... | [
"tornado.ioloop.IOLoop.instance",
"flask_script.Manager",
"logging.Formatter",
"unittest.TestLoader",
"flask_script.Shell",
"os.path.join",
"tornado.wsgi.WSGIContainer",
"os.path.dirname",
"tornado.log.LogFormatter",
"flask_migrate.Migrate",
"werkzeug.contrib.profiler.ProfilerMiddleware",
"os.... | [((478, 490), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (485, 490), False, 'from flask_script import Manager, Shell\n'), ((501, 517), 'flask_migrate.Migrate', 'Migrate', (['app', 'db'], {}), '(app, db)\n', (508, 517), False, 'from flask_migrate import Migrate, MigrateCommand\n'), ((1820, 1852), 'os.e... |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import simplejson... | [
"flask_babelex.gettext",
"pgadmin.tools.schema_diff.node_registry.SchemaDiffRegistry",
"pgadmin.utils.ajax.internal_server_error",
"pgadmin.utils.ajax.make_json_response",
"simplejson.loads",
"pgadmin.utils.driver.get_driver",
"functools.wraps",
"re.search",
"pgadmin.utils.ajax.make_response",
"re... | [((26430, 26499), 'pgadmin.tools.schema_diff.node_registry.SchemaDiffRegistry', 'SchemaDiffRegistry', (['blueprint.node_type', 'EventTriggerView', '"""Database"""'], {}), "(blueprint.node_type, EventTriggerView, 'Database')\n", (26448, 26499), False, 'from pgadmin.tools.schema_diff.node_registry import SchemaDiffRegist... |
import pyOcean_cpu as ocean
import numpy as np
import pyOceanNumpy
a = np.arange(24).reshape([3,2,4])
print(a)
b = ocean.asTensor(a).reverseAxes2()
print(b)
b.fill(3)
b.sync()
print(a)
| [
"numpy.arange",
"pyOcean_cpu.asTensor"
] | [((72, 85), 'numpy.arange', 'np.arange', (['(24)'], {}), '(24)\n', (81, 85), True, 'import numpy as np\n'), ((116, 133), 'pyOcean_cpu.asTensor', 'ocean.asTensor', (['a'], {}), '(a)\n', (130, 133), True, 'import pyOcean_cpu as ocean\n')] |
# This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Unit tests for the update operator in data processing pipelines."""
from openclean.function.eval.base ... | [
"openclean.function.eval.base.Col"
] | [((462, 470), 'openclean.function.eval.base.Col', 'Col', (['"""B"""'], {}), "('B')\n", (465, 470), False, 'from openclean.function.eval.base import Col\n'), ((473, 481), 'openclean.function.eval.base.Col', 'Col', (['"""C"""'], {}), "('C')\n", (476, 481), False, 'from openclean.function.eval.base import Col\n')] |
import math
import random
num = random.random()
show = math.trunc(num)
print('O numero {}, inteiro fica {}'.format(num, show)) | [
"random.random",
"math.trunc"
] | [((32, 47), 'random.random', 'random.random', ([], {}), '()\n', (45, 47), False, 'import random\n'), ((56, 71), 'math.trunc', 'math.trunc', (['num'], {}), '(num)\n', (66, 71), False, 'import math\n')] |
"""7. The treachery of whales."""
from enum import Enum
from statistics import mean, median
def find_fuel_spend_using_simple_rule(horizontal_positions: str) -> int:
"""Finds the minimum fuel spend required to align the crab submarines."""
crab_positions = [int(p) for p in horizontal_positions.split(",")]
... | [
"statistics.median",
"statistics.mean"
] | [((340, 362), 'statistics.median', 'median', (['crab_positions'], {}), '(crab_positions)\n', (346, 362), False, 'from statistics import mean, median\n'), ((1319, 1339), 'statistics.mean', 'mean', (['crab_positions'], {}), '(crab_positions)\n', (1323, 1339), False, 'from statistics import mean, median\n')] |
import tdameritrade as td
from ib_insync import *
import os
import asyncio
from util import *
import wrapper
from PyQt5.QtWidgets import QApplication
import PyQt5.QtWidgets as qt
from PyQt5.QtGui import QPalette
from PyQt5 import QtGui
from PyQt5.QtCore import Qt
from PyQt5 import QtCore
class TickerTable(qt.QTable... | [
"asyncio.get_event_loop",
"PyQt5.QtGui.QColor",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtGui.QPalette",
"PyQt5.QtWidgets.QTableWidget.__init__",
"PyQt5.QtWidgets.QWidget.__init__",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidgets.QTableWidgetItem",
"PyQt5.QtWidgets.QAppl... | [((5256, 5291), 'os.getenv', 'os.getenv', (['"""TDAMERITRADE_CLIENT_ID"""'], {}), "('TDAMERITRADE_CLIENT_ID')\n", (5265, 5291), False, 'import os\n'), ((5303, 5319), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['[]'], {}), '([])\n', (5315, 5319), False, 'from PyQt5.QtWidgets import QApplication\n'), ((5367, 5377),... |
from mayavi import mlab
import itertools
# import rotanimate
from sklearn.decomposition import PCA
from collections import OrderedDict
# setting up figure
fig = mlab.figure('hitleys', bgcolor=(1,1,1))
fig.scene.disable_render = True
# fig = plt.figure(dpi=100)
# ax = fig.add_subplot(111, projection='3d')
# fig_2 = plt... | [
"mayavi.mlab.text3d",
"mayavi.mlab.figure",
"mayavi.mlab.points3d",
"sklearn.decomposition.PCA",
"collections.OrderedDict",
"itertools.chain",
"mayavi.mlab.orientation_axes"
] | [((162, 203), 'mayavi.mlab.figure', 'mlab.figure', (['"""hitleys"""'], {'bgcolor': '(1, 1, 1)'}), "('hitleys', bgcolor=(1, 1, 1))\n", (173, 203), False, 'from mayavi import mlab\n'), ((556, 575), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(3)'}), '(n_components=3)\n', (559, 575), False, 'from sklearn.de... |
import logging
import sys
logger = logging.getLogger("data")
# Configure the main logger for the data package
if not logger.handlers:
handler = logging.StreamHandler(sys.stdout)
formatting = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
handler.setFormatter(formatting)
handler.setLeve... | [
"logging.Formatter",
"logging.StreamHandler",
"logging.getLogger"
] | [((36, 61), 'logging.getLogger', 'logging.getLogger', (['"""data"""'], {}), "('data')\n", (53, 61), False, 'import logging\n'), ((150, 183), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (171, 183), False, 'import logging\n'), ((201, 263), 'logging.Formatter', 'logging.Format... |
import unittest
from troposphere import Parameter, Ref, NoValue
from troposphere.validators import boolean, integer, integer_range
from troposphere.validators import positive_integer, network_port
from troposphere.validators import tg_healthcheck_port
from troposphere.validators import s3_bucket_name, encoding, status
... | [
"troposphere.Ref",
"troposphere.validators.iam_names",
"troposphere.validators.positive_integer",
"troposphere.validators.encoding",
"troposphere.validators.waf_action_type",
"troposphere.validators.operating_system",
"unittest.main",
"troposphere.validators.notification_type",
"troposphere.validato... | [((9324, 9339), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9337, 9339), False, 'import unittest\n'), ((2079, 2100), 'troposphere.validators.integer_range', 'integer_range', (['(10)', '(20)'], {}), '(10, 20)\n', (2092, 2100), False, 'from troposphere.validators import boolean, integer, integer_range\n'), ((267... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# <NAME> <<EMAIL>>
# (c) 1998-2021 all rights reserved
def test():
"""
Verify that the device base class is not exported
"""
# access
import journal
# attempt to
try:
# access the device base class
journal.Device()
... | [
"journal.Device"
] | [((295, 311), 'journal.Device', 'journal.Device', ([], {}), '()\n', (309, 311), False, 'import journal\n')] |
##############################################
##### Predicting EUR/USD pair using LSTM #####
##############################################
###################################
### Part 1 - Data Preprocessing ###
###################################
### Importing the libraries ###
import numpy as np
import pandas as p... | [
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.MinMaxScaler",
"numpy.append",
"numpy.reshape",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.show",
"keras.layers.Dropout",
"matplotlib.pyplot.legend",
"keras.optimizers.Adam",
"datetime.datetime.st... | [((364, 390), 'pandas.read_csv', 'pd.read_csv', (['"""dataset.csv"""'], {}), "('dataset.csv')\n", (375, 390), True, 'import pandas as pd\n'), ((1746, 1780), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {'feature_range': '(0, 1)'}), '(feature_range=(0, 1))\n', (1758, 1780), False, 'from sklearn.preprocessi... |
import logging
from argparse import ArgumentParser
from typing import Any, List
from django.conf import settings
from django.db import transaction
from zerver.lib.logging_util import log_to_file
from zerver.lib.management import ZulipBaseCommand
from zerver.models import UserProfile
from zproject.backends import Zuli... | [
"zerver.models.UserProfile.objects.filter",
"zerver.models.UserProfile.objects.select_related",
"zerver.lib.logging_util.log_to_file",
"zproject.backends.sync_user_from_ldap",
"django.db.transaction.atomic",
"logging.getLogger"
] | [((378, 424), 'logging.getLogger', 'logging.getLogger', (['"""zulip.sync_ldap_user_data"""'], {}), "('zulip.sync_ldap_user_data')\n", (395, 424), False, 'import logging\n'), ((425, 473), 'zerver.lib.logging_util.log_to_file', 'log_to_file', (['logger', 'settings.LDAP_SYNC_LOG_PATH'], {}), '(logger, settings.LDAP_SYNC_L... |
# coding=utf-8
# Copyright 2022 The TensorFlow Datasets Authors.
#
# 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 appl... | [
"textwrap.dedent",
"unittest.mock.patch.object",
"tensorflow_datasets.core.github_api.github_path.GithubPath",
"os.fspath",
"pytest.mark.skipif",
"pytest.raises",
"tensorflow_datasets.core.github_api.github_path._parse_github_path",
"tensorflow_datasets.core.github_api.github_path.GithubPath.from_repo... | [((951, 1026), 'pytest.mark.skipif', 'pytest.mark.skipif', (['_SKIP_NON_HERMETIC'], {'reason': '"""Non-hermetic test skipped."""'}), "(_SKIP_NON_HERMETIC, reason='Non-hermetic test skipped.')\n", (969, 1026), False, 'import pytest\n'), ((1120, 1490), 'textwrap.dedent', 'textwrap.dedent', (['""" # This is the list of... |
"""
Author: <NAME>
Date: 10 April 2021
"""
import logging
import os
from typing import List, Union
import shutil
from dataclasses import dataclass
from concurrent.futures import ThreadPoolExecutor, as_completed, Future
from threading import Lock
import urllib.parse
import json
import glob
from zipfile import... | [
"os.mkdir",
"os.remove",
"zipfile.ZipFile",
"os.path.exists",
"sla_cli.src.common.path.Path.isic_metadata",
"concurrent.futures.as_completed",
"threading.Lock",
"shutil.move",
"shutil.rmtree",
"concurrent.futures.ThreadPoolExecutor",
"os.path.join",
"os.listdir",
"logging.getLogger"
] | [((687, 714), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (704, 714), False, 'import logging\n'), ((2283, 2342), 'os.path.join', 'os.path.join', (['self.destination_directory', 'self.dataset_name'], {}), '(self.destination_directory, self.dataset_name)\n', (2295, 2342), False, 'import ... |
from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_sucessfull(self):
"""Test Create with a new user with an email is sucessfull"""
email = "<EMAIL>"
password = "<PASSWORD>"
# import pdb; pdb.se... | [
"django.contrib.auth.get_user_model"
] | [((345, 361), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (359, 361), False, 'from django.contrib.auth import get_user_model\n'), ((812, 828), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (826, 828), False, 'from django.contrib.auth import get_user_model\n'), (... |
from __future__ import absolute_import
from pyhwcomm.machine import CPU, GPU, Machine
from pyhwcomm.link import QPI48, PCIe3x16
class Intel(Machine):
def __init__(self):
Machine.__init__(self)
self.cpu0 = CPU(0)
self.cpu1 = CPU(1)
self.topology.add_edge(self.cpu0, self.cpu1, link=Q... | [
"pyhwcomm.machine.Machine.__init__",
"pyhwcomm.machine.GPU",
"pyhwcomm.link.QPI48",
"pyhwcomm.machine.CPU",
"pyhwcomm.link.PCIe3x16"
] | [((184, 206), 'pyhwcomm.machine.Machine.__init__', 'Machine.__init__', (['self'], {}), '(self)\n', (200, 206), False, 'from pyhwcomm.machine import CPU, GPU, Machine\n'), ((227, 233), 'pyhwcomm.machine.CPU', 'CPU', (['(0)'], {}), '(0)\n', (230, 233), False, 'from pyhwcomm.machine import CPU, GPU, Machine\n'), ((254, 26... |
#!/usr/bin/python3
import serial # pip3 install pyserial
import argparse
import time
import scipy.signal
from rtlsdr import RtlSdr # pip3 install pyrtlsdr
import numpy as np
import matplotlib.pyplot as plt
import csv
def isFloat(string):
try:
float(string)
return True
except ValueError:
... | [
"serial.Serial",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"csv.reader",
"rtlsdr.RtlSdr",
"matplotlib.pyplot.legend",
"time.sleep",
"numpy.min",
"numpy.mean",
"numpy.arange",
"rtlsdr.RtlSdr.get_device_serial_addresses",
"matplo... | [((2287, 2366), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""EMI mapping with 3D-printer and RTL-SDR."""'}), "(description='EMI mapping with 3D-printer and RTL-SDR.')\n", (2310, 2366), False, 'import argparse\n'), ((3565, 3611), 'numpy.arange', 'np.arange', (['freq_lbound', 'freq_uboun... |