code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# 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... | [
"milvus.Milvus",
"sys.exit"
] | [((808, 850), 'milvus.Milvus', 'Milvus', ([], {'host': 'MILVUS_HOST', 'port': 'MILVUS_PORT'}), '(host=MILVUS_HOST, port=MILVUS_PORT)\n', (814, 850), False, 'from milvus import Milvus, IndexType\n'), ((1081, 1092), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1089, 1092), False, 'import sys\n'), ((1395, 1406), 'sys.... |
import numpy as np
import pytest
import taichi as ti
from tests import test_utils
def with_data_type(dt):
val = ti.field(ti.i32)
n = 4
ti.root.dense(ti.i, n).place(val)
@ti.kernel
def test_numpy(arr: ti.ext_arr()):
for i in range(n):
arr[i] = arr[i]**2
a = np.array([4,... | [
"taichi.ndrange",
"taichi.field",
"tests.test_utils.test",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"taichi.grouped",
"pytest.raises",
"taichi.ext_arr",
"taichi.root.dense",
"taichi.any_arr"
] | [((466, 483), 'tests.test_utils.test', 'test_utils.test', ([], {}), '()\n', (481, 483), False, 'from tests import test_utils\n'), ((540, 584), 'tests.test_utils.test', 'test_utils.test', ([], {'require': 'ti.extension.data64'}), '(require=ti.extension.data64)\n', (555, 584), False, 'from tests import test_utils\n'), ((... |
import os
import glob
import json
from invoke import task
from .vars import package_name, doc_notebooks_dir
@task
def test(c, option="", html=False, xml=False, notebook_tests=True):
comm = "python -m pytest --cov={}".format(package_name)
if option:
comm += " --{}".format(option)
if html:
... | [
"os.path.exists",
"os.path.join",
"os.makedirs"
] | [((1118, 1153), 'os.path.join', 'os.path.join', (['package_name', '"""tests"""'], {}), "(package_name, 'tests')\n", (1130, 1153), False, 'import os\n'), ((1261, 1311), 'os.path.join', 'os.path.join', (['test_root', '"""test_nb_integrations.py"""'], {}), "(test_root, 'test_nb_integrations.py')\n", (1273, 1311), False, '... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import theano
import theano.tensor as T
from .. import activations, initializations, regularizers, constraints
from ..utils.theano_utils import shared_zeros
from ..layers.core import Layer
class Convolution1D(Layer):
def __init__(self, input_dim, nb... | [
"theano.tensor.nnet.conv.conv2d",
"theano.tensor.signal.downsample.max_pool_2d",
"theano.tensor.tensor3",
"theano.tensor.zeros",
"theano.tensor.reshape",
"theano.tensor.set_subtensor",
"theano.tensor.tensor4"
] | [((1160, 1171), 'theano.tensor.tensor3', 'T.tensor3', ([], {}), '()\n', (1169, 1171), True, 'import theano.tensor as T\n'), ((2453, 2543), 'theano.tensor.nnet.conv.conv2d', 'T.nnet.conv.conv2d', (['X', 'self.W'], {'border_mode': 'self.border_mode', 'subsample': 'self.subsample'}), '(X, self.W, border_mode=self.border_m... |
# Python imports
from collections.abc import Sequence
import numpy as np
''' StateClass.py: Contains the State Class. '''
class State(Sequence):
''' Abstract State class '''
def __init__(self, data=[], is_terminal=False):
self.data = data
self._is_terminal = is_terminal
def features(sel... | [
"numpy.array"
] | [((616, 635), 'numpy.array', 'np.array', (['self.data'], {}), '(self.data)\n', (624, 635), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
'''
Watch files and translate the changes into salt events
:depends: - pyinotify Python module >= 0.9.5
:Caution: Using generic mask options like open, access, ignored, and
closed_nowrite with reactors can easily cause the reactor
to loop on itself.
'''
# Import Py... | [
"logging.getLogger",
"pyinotify.WatchManager",
"collections.deque",
"pyinotify.Notifier"
] | [((873, 900), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (890, 900), False, 'import logging\n'), ((1410, 1429), 'collections.deque', 'collections.deque', ([], {}), '()\n', (1427, 1429), False, 'import collections\n'), ((1443, 1467), 'pyinotify.WatchManager', 'pyinotify.WatchManager', ... |
import json
import random
import sys
import os
import getopt
from action_batches import create_action_batch, check_until_completed
from time import sleep
import csv
import meraki
dashboard = meraki.DashboardAPI()
def check_batch_completion(org,batch_id):
counter = 0
while True:
batch = dashboard.organ... | [
"getopt.getopt",
"csv.DictReader",
"time.sleep",
"sys.exit",
"meraki.DashboardAPI"
] | [((192, 213), 'meraki.DashboardAPI', 'meraki.DashboardAPI', ([], {}), '()\n', (211, 213), False, 'import meraki\n'), ((6978, 7034), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hcd"""', "['create', 'delete']"], {}), "(sys.argv[1:], 'hcd', ['create', 'delete'])\n", (6991, 7034), False, 'import getopt\n'), ((9... |
from abc import ABC
from typing import Optional
from recipe_db.analytics.spotlight.style import StyleAnalysis
from recipe_db.models import Style
from web_app.charts.utils import NoDataException, Chart, ChartDefinition
from web_app.meta import OPEN_GRAPH_IMAGE_WIDTH, OPEN_GRAPH_IMAGE_HEIGHT
from web_app.plot import Lin... | [
"web_app.plot.LinesChart",
"web_app.charts.utils.NoDataException",
"web_app.plot.PreAggregatedPairsBoxPlot",
"recipe_db.analytics.spotlight.style.StyleAnalysis",
"web_app.plot.PreAggregateHistogramChart",
"web_app.plot.PreAggregatedBoxPlot"
] | [((1115, 1132), 'web_app.charts.utils.NoDataException', 'NoDataException', ([], {}), '()\n', (1130, 1132), False, 'from web_app.charts.utils import NoDataException, Chart, ChartDefinition\n'), ((1558, 1575), 'web_app.charts.utils.NoDataException', 'NoDataException', ([], {}), '()\n', (1573, 1575), False, 'from web_app.... |
# Copyright The OpenTelemetry 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 applicable law or agreed to in ... | [
"logging.getLogger",
"pkg_resources.iter_entry_points"
] | [((2398, 2417), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (2407, 2417), False, 'from logging import getLogger\n'), ((3661, 3709), 'pkg_resources.iter_entry_points', 'iter_entry_points', (['"""opentelemetry_error_handler"""'], {}), "('opentelemetry_error_handler')\n", (3678, 3709), False, 'fr... |
from cyclone import web
from oonib import log
from oonib.config import config
class _LaxDict(dict):
"""
This is like a dictionary, but when a key is missing it returns the
empty string.
"""
def __missing__(self, _):
return ""
def log_function(handler):
values = _LaxDict({
're... | [
"oonib.report.handlers.checkForStaleReports",
"cyclone.web.Application.__init__"
] | [((1495, 1517), 'oonib.report.handlers.checkForStaleReports', 'checkForStaleReports', ([], {}), '()\n', (1515, 1517), False, 'from oonib.report.handlers import checkForStaleReports\n'), ((1527, 1617), 'cyclone.web.Application.__init__', 'web.Application.__init__', (['self', 'handlers'], {'name': '"""collector"""', 'log... |
"""Hub for communication with 1-Wire server or mount_dir."""
from __future__ import annotations
import logging
import os
from typing import TYPE_CHECKING
from pi1wire import Pi1Wire
from pyownet import protocol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_IDENTIFIER... | [
"logging.getLogger",
"pi1wire.Pi1Wire",
"homeassistant.helpers.device_registry.async_get",
"os.path.split"
] | [((1175, 1202), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1192, 1202), False, 'import logging\n'), ((2476, 2494), 'pi1wire.Pi1Wire', 'Pi1Wire', (['mount_dir'], {}), '(mount_dir)\n', (2483, 2494), False, 'from pi1wire import Pi1Wire\n'), ((3299, 3322), 'homeassistant.helpers.device_r... |
# ******************************************************************************
# This file is part of the AaMakro5oul project
# (An OSC/MIDI controller for Ableton Live with DJ features)
#
# Full project source: https://github.com/hiramegl/AaMakro5oul
#
# License : Apache License 2.0
# Full license: https://githu... | [
"CoreHandler.CoreHandler.__init__"
] | [((884, 949), 'CoreHandler.CoreHandler.__init__', 'CoreHandler.__init__', (['self', '_oCtrlInstance', '_oOscServer', '_hConfig'], {}), '(self, _oCtrlInstance, _oOscServer, _hConfig)\n', (904, 949), False, 'from CoreHandler import CoreHandler\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import numpy as np
import argparse
import random
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
import utils
from util... | [
"numpy.ones",
"argparse.ArgumentParser",
"torch.Tensor",
"numpy.argmax",
"ModelNet40Loader.ModelNet40Cls",
"numpy.array",
"numpy.random.randint",
"numpy.zeros",
"numpy.sum",
"numpy.vstack",
"data_utils.PointcloudToTensor",
"torch.cuda.is_available",
"test_debugged.test.pointnet2_cls_ssg.get_... | [((567, 592), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (590, 592), False, 'import argparse\n'), ((3560, 3656), 'ModelNet40Loader.ModelNet40Cls', 'ModelNet40Loader.ModelNet40Cls', (['opt.pnum'], {'train': '(False)', 'transforms': 'transforms', 'download': '(False)'}), '(opt.pnum, train=Fal... |
'''
Double Tap
==========
Search touch for a double tap
'''
__all__ = ('InputPostprocDoubleTap', )
from time import time
from nuiinput.config import Config
from nuiinput.vector import Vector
class InputPostprocDoubleTap(object):
'''
InputPostProcDoubleTap is a post-processor to check if
a touch is a do... | [
"nuiinput.vector.Vector",
"nuiinput.config.Config.getint",
"time.time"
] | [((603, 651), 'nuiinput.config.Config.getint', 'Config.getint', (['"""postproc"""', '"""double_tap_distance"""'], {}), "('postproc', 'double_tap_distance')\n", (616, 651), False, 'from nuiinput.config import Config\n'), ((720, 764), 'nuiinput.config.Config.getint', 'Config.getint', (['"""postproc"""', '"""double_tap_ti... |
"""Module for Testing the InVEST Wave Energy module."""
import unittest
import tempfile
import shutil
import os
import re
import numpy
import numpy.testing
from osgeo import gdal
from osgeo import osr, ogr
from shapely.geometry import Polygon
from shapely.geometry import Point
import pygeoprocessing.tes... | [
"natcap.invest.wave_energy._pixel_size_based_on_coordinate_transform",
"shapely.geometry.Point",
"numpy.array",
"shapely.geometry.Polygon",
"natcap.invest.wave_energy._count_pixels_groups",
"numpy.arange",
"osgeo.osr.CoordinateTransformation",
"os.path.exists",
"numpy.testing.assert_array_almost_equ... | [((504, 542), 'os.path.join', 'os.path.join', (['REGRESSION_DATA', '"""input"""'], {}), "(REGRESSION_DATA, 'input')\n", (516, 542), False, 'import os\n'), ((413, 438), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (428, 438), False, 'import os\n'), ((1400, 1435), 'os.path.join', 'os.path.joi... |
"""
双均线策略
此策略适用于OKEX的现货
如需用于其他类型合约或现货,可自行修改
Author: Gary-Hertel
Date: 2020/09/01
email: <EMAIL>
"""
from purequant.indicators import INDICATORS
from purequant.trade import OKEXSPOT
from purequant.position import POSITION
from purequant.market import MARKET
from purequant.logger import logger
from purequant.push impo... | [
"purequant.push.push",
"purequant.storage.storage.mysql_save_strategy_run_info",
"purequant.position.POSITION",
"purequant.market.MARKET",
"purequant.logger.logger.warning",
"purequant.storage.storage.read_mysql_datas",
"purequant.config.config.loads",
"purequant.logger.logger.info",
"purequant.trad... | [((692, 719), 'purequant.config.config.loads', 'config.loads', (['"""config.json"""'], {}), "('config.json')\n", (704, 719), False, 'from purequant.config import config\n'), ((918, 1008), 'purequant.trade.OKEXSPOT', 'OKEXSPOT', (['config.access_key', 'config.secret_key', 'config.passphrase', 'self.instrument_id'], {}),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import markdown
import glob
import os.path
head='''
<head>
<title>mgq: Minimal Gram task Queue</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="icon" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" >
... | [
"markdown.Markdown",
"glob.glob"
] | [((1909, 1969), 'markdown.Markdown', 'markdown.Markdown', ([], {'output_format': '"""html5"""', 'extensions': "['gfm']"}), "(output_format='html5', extensions=['gfm'])\n", (1926, 1969), False, 'import markdown\n'), ((2243, 2260), 'glob.glob', 'glob.glob', (['"""*.md"""'], {}), "('*.md')\n", (2252, 2260), False, 'import... |
"""
Single-pole balancing experiment using a feed-forward neural network.
"""
from __future__ import print_function
import multiprocessing
import os
import pickle
import neat
import cart_pole
import visualize
runs_per_net = 5
simulation_seconds = 60.0
# Use the NN network phenotype and the discrete actuator for... | [
"pickle.dump",
"neat.StdOutReporter",
"neat.Population",
"visualize.plot_species",
"os.path.join",
"neat.nn.FeedForwardNetwork.create",
"neat.Config",
"visualize.draw_net",
"multiprocessing.cpu_count",
"os.path.dirname",
"neat.StatisticsReporter",
"visualize.plot_stats",
"cart_pole.CartPole"... | [((376, 425), 'neat.nn.FeedForwardNetwork.create', 'neat.nn.FeedForwardNetwork.create', (['genome', 'config'], {}), '(genome, config)\n', (409, 425), False, 'import neat\n'), ((1648, 1673), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1663, 1673), False, 'import os\n'), ((1692, 1737), 'os.... |
import numpy as np
import pandas as pd
from drsu.datasets import DatasetDescriptor
from drsu.datasets._utils import make_ratings_file_path
def as_pandas(dataset_descriptor: DatasetDescriptor, only_ratings=True) -> pd.DataFrame:
full_df = pd.read_csv(make_ratings_file_path(dataset_descriptor), sep=',')
if onl... | [
"drsu.datasets._utils.make_ratings_file_path"
] | [((257, 299), 'drsu.datasets._utils.make_ratings_file_path', 'make_ratings_file_path', (['dataset_descriptor'], {}), '(dataset_descriptor)\n', (279, 299), False, 'from drsu.datasets._utils import make_ratings_file_path\n')] |
"""
Tools for Projected Entangled Pair States
Author: <NAME> <<EMAIL>>
Date: July 2019
.. Note, peps tensors are stored in order:
(5) top
|
(1) left ___|___ (4) right
|\
| \
(2) bottom (3) physical
"""
from cyclopeps.tools.gen_ten import rand,einsum,eye,ones,sv... | [
"cyclopeps.tools.mps_tools.MPS",
"numpy.prod",
"cyclopeps.tools.gen_ten.eye",
"cyclopeps.tools.gen_ten.ones",
"cyclopeps.tools.gen_ten.zeros",
"cyclopeps.tools.gen_ten.rand",
"numpy.isfinite",
"cyclopeps.tools.gen_ten.einsum"
] | [((3961, 3975), 'cyclopeps.tools.mps_tools.MPS', 'MPS', (['bound_mpo'], {}), '(bound_mpo)\n', (3964, 3975), False, 'from cyclopeps.tools.mps_tools import MPS, identity_mps\n'), ((6850, 6868), 'cyclopeps.tools.mps_tools.MPS', 'MPS', (['bound_mpo_new'], {}), '(bound_mpo_new)\n', (6853, 6868), False, 'from cyclopeps.tools... |
from discord.colour import Colour
from discord.embeds import Embed
from discord.ext import commands
from youtube_search import YoutubeSearch
class NFYouTube(commands.Cog):
def __init__(self, bot, id):
self.bot = bot
self.cog_id = id
@commands.command('yt')
async def yt_search(... | [
"youtube_search.YoutubeSearch",
"discord.colour.Colour",
"discord.ext.commands.command"
] | [((272, 294), 'discord.ext.commands.command', 'commands.command', (['"""yt"""'], {}), "('yt')\n", (288, 294), False, 'from discord.ext import commands\n'), ((838, 865), 'discord.ext.commands.command', 'commands.command', (['"""yt-list"""'], {}), "('yt-list')\n", (854, 865), False, 'from discord.ext import commands\n'),... |
import numpy as np
import ray
import ray.rllib.algorithms.ppo as ppo
import onnxruntime
import os
import shutil
# Configure our PPO.
config = ppo.DEFAULT_CONFIG.copy()
config["num_gpus"] = 0
config["num_workers"] = 1
config["framework"] = "tf"
outdir = "export_tf"
if os.path.exists(outdir):
shutil.rmtree(outdir)
... | [
"os.path.exists",
"numpy.allclose",
"ray.init",
"os.path.join",
"onnxruntime.InferenceSession",
"numpy.random.uniform",
"numpy.random.seed",
"ray.rllib.algorithms.ppo.PPO",
"shutil.rmtree",
"ray.rllib.algorithms.ppo.DEFAULT_CONFIG.copy"
] | [((143, 168), 'ray.rllib.algorithms.ppo.DEFAULT_CONFIG.copy', 'ppo.DEFAULT_CONFIG.copy', ([], {}), '()\n', (166, 168), True, 'import ray.rllib.algorithms.ppo as ppo\n'), ((270, 292), 'os.path.exists', 'os.path.exists', (['outdir'], {}), '(outdir)\n', (284, 292), False, 'import os\n'), ((321, 341), 'numpy.random.seed', ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from distutils.version import LooseVersion
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth import get_user_model
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers imp... | [
"django.contrib.auth.get_user_model",
"django.utils.translation.ugettext_lazy",
"django.http.HttpResponseBadRequest",
"django.template.response.TemplateResponse",
"django.http.HttpResponse",
"django.contrib.admin.utils.label_for_field",
"django.core.urlresolvers.reverse",
"django.utils.six.create_boun... | [((1818, 1834), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (1832, 1834), False, 'from django.contrib.auth import get_user_model\n'), ((2407, 2423), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (2421, 2423), False, 'from django.contrib.auth import get_user_mode... |
from django.contrib import admin
from recipe_app.models import Author, RecipeItems
admin.site.register(Author)
admin.site.register(RecipeItems) | [
"django.contrib.admin.site.register"
] | [((84, 111), 'django.contrib.admin.site.register', 'admin.site.register', (['Author'], {}), '(Author)\n', (103, 111), False, 'from django.contrib import admin\n'), ((112, 144), 'django.contrib.admin.site.register', 'admin.site.register', (['RecipeItems'], {}), '(RecipeItems)\n', (131, 144), False, 'from django.contrib ... |
"""
Setup for pypi support
"""
import codecs
import os
import sys
from setuptools import find_packages, setup # , setup, Command
PROJECT_NAME = "jiggle_version"
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = "\n" + ... | [
"setuptools.find_packages",
"os.path.join",
"os.path.dirname",
"sys.exit",
"os.system"
] | [((188, 213), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (203, 213), False, 'import os\n'), ((465, 518), 'os.system', 'os.system', (['"""python setup.py sdist bdist_wheel upload"""'], {}), "('python setup.py sdist bdist_wheel upload')\n", (474, 518), False, 'import os\n'), ((523, 533), 's... |
__all__ = ()
import sys
import objc
from objc._objc import _nameForSignature
basic_types = {
objc._C_VOID: "void",
objc._C_INT: "int",
objc._C_UINT: "unsigned int",
objc._C_LNG: "long",
objc._C_ULNG: "unsigned long",
objc._C_LNG_LNG: "long long",
... | [
"inspect.Parameter",
"inspect.Signature",
"objc._objc._nameForSignature"
] | [((1342, 1368), 'objc._objc._nameForSignature', '_nameForSignature', (['typestr'], {}), '(typestr)\n', (1359, 1368), False, 'from objc._objc import _nameForSignature\n'), ((1624, 1650), 'objc._objc._nameForSignature', '_nameForSignature', (['typestr'], {}), '(typestr)\n', (1641, 1650), False, 'from objc._objc import _n... |
from configparser import ConfigParser
DEFAULT_INTERVAL = 30
DEFAULT_TITLE = "Hora de levantar da cadeira"
DEFAULT_MSG = "Aproveita para fazer também algum exercício físico"
def get_configs():
config = ConfigParser()
config.read('config.ini', encoding='utf-8')
try:
interval = float(config['DEFAUL... | [
"configparser.ConfigParser"
] | [((209, 223), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (221, 223), False, 'from configparser import ConfigParser\n')] |
import math
import os
import time
import numpy as np
import pandas as pd
import scipy.io as scio
import geatpy as ea
import warnings
class Problem:
def __init__(self, name, M, maxormins, Dim, varTypes, lb, ub, lbin, ubin, aimFunc=None, calReferObjV=None):
self.name = name
self.M = M
self.... | [
"geatpy.Xovpmx",
"numpy.random.rand",
"pandas.read_csv",
"numpy.hstack",
"numpy.array",
"geatpy.SoeaAlgorithm.__init__",
"geatpy.Mutinv",
"os.path.exists",
"numpy.where",
"numpy.delete",
"numpy.vstack",
"numpy.concatenate",
"warnings.warn",
"numpy.isinf",
"numpy.abs",
"numpy.ones",
"... | [((332, 351), 'numpy.array', 'np.array', (['maxormins'], {}), '(maxormins)\n', (340, 351), True, 'import numpy as np\n'), ((399, 417), 'numpy.array', 'np.array', (['varTypes'], {}), '(varTypes)\n', (407, 417), True, 'import numpy as np\n'), ((440, 458), 'numpy.array', 'np.array', (['[lb, ub]'], {}), '([lb, ub])\n', (44... |
from django.contrib import admin
from django.db import models
from django.forms import TextInput
from solo.admin import SingletonModelAdmin
from .models import ParserConfiguration, TitleConfiguration
class TitleConfigurationInline(admin.TabularInline):
formfield_overrides = {
models.TextField: {
... | [
"django.contrib.admin.register",
"django.forms.TextInput"
] | [((485, 520), 'django.contrib.admin.register', 'admin.register', (['ParserConfiguration'], {}), '(ParserConfiguration)\n', (499, 520), False, 'from django.contrib import admin\n'), ((335, 389), 'django.forms.TextInput', 'TextInput', ([], {'attrs': "{'style': 'width: calc(100% - 1em);'}"}), "(attrs={'style': 'width: cal... |
import time
from keras.preprocessing.sequence import pad_sequences
from sklearn.metrics import precision_score,recall_score
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
from utils import GeneSeg
import csv,random,pickle
batch_size=500
maxlen=200
vec_dir="file\\word2vec.pickle... | [
"csv.DictReader",
"pickle.dump",
"sklearn.model_selection.train_test_split",
"sklearn.svm.LinearSVC",
"pickle.load",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"utils.GeneSeg",
"keras.preprocessing.sequence.pad_sequences",
"time.time"
] | [((1682, 1733), 'keras.preprocessing.sequence.pad_sequences', 'pad_sequences', (['datas_index'], {'value': '(-1)', 'maxlen': 'maxlen'}), '(datas_index, value=-1, maxlen=maxlen)\n', (1695, 1733), False, 'from keras.preprocessing.sequence import pad_sequences\n'), ((2327, 2379), 'sklearn.model_selection.train_test_split'... |
from __future__ import unicode_literals
import unittest, frappe
from frappe.modules import patch_handler
class TestPatches(unittest.TestCase):
def test_patch_module_names(self):
frappe.flags.final_patches = []
frappe.flags.in_install = True
for patchmodule in patch_handler.get_all_patches():
if patchmodule.s... | [
"frappe.modules.patch_handler.get_all_patches"
] | [((268, 299), 'frappe.modules.patch_handler.get_all_patches', 'patch_handler.get_all_patches', ([], {}), '()\n', (297, 299), False, 'from frappe.modules import patch_handler\n')] |
import sys
sys.path.append('../')
from game_contents.GameOverJudgement import GameOverJudgement
from game_contents.SpecReader import SpecReader
spec = SpecReader("assets/spec.txt")
field_size = ( spec.spec["fieldrow"], spec.spec["fieldcolmun"] )
judgement = None
def test_JudgeSnakeOutsideField():
for x in rang... | [
"game_contents.GameOverJudgement.GameOverJudgement.JudgeSnakeOutsideField",
"sys.path.append",
"game_contents.SpecReader.SpecReader",
"game_contents.GameOverJudgement.GameOverJudgement.JudgeCollideHeadAndBody"
] | [((13, 35), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (28, 35), False, 'import sys\n'), ((155, 184), 'game_contents.SpecReader.SpecReader', 'SpecReader', (['"""assets/spec.txt"""'], {}), "('assets/spec.txt')\n", (165, 184), False, 'from game_contents.SpecReader import SpecReader\n'), ((178... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from django.views.generic.base import RedirectView
import djangosaml2_spid.urls
urlpatterns = [
path('admin/', admin.site.urls),
path('', include((djangosaml2_spid.... | [
"django.conf.urls.static.static",
"django.urls.path",
"django.views.generic.base.RedirectView.as_view",
"django.urls.include"
] | [((457, 520), 'django.conf.urls.static.static', 'static', (['settings.STATIC_URL'], {'document_root': 'settings.STATIC_ROOT'}), '(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\n', (463, 520), False, 'from django.conf.urls.static import static\n'), ((248, 279), 'django.urls.path', 'path', (['"""admin/"""', 'a... |
# Generated by Selenium IDE
from operator import index
import time
import json
import base64
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.sup... | [
"selenium.webdriver.support.ui.WebDriverWait",
"operator.index",
"requests.get",
"time.sleep",
"selenium.webdriver.PhantomJS",
"selenium.webdriver.common.action_chains.ActionChains"
] | [((6589, 6596), 'operator.index', 'index', ([], {}), '()\n', (6594, 6596), False, 'from operator import index\n'), ((780, 787), 'operator.index', 'index', ([], {}), '()\n', (785, 787), False, 'from operator import index\n'), ((1034, 1055), 'selenium.webdriver.PhantomJS', 'webdriver.PhantomJS', ([], {}), '()\n', (1053, ... |
# Copyright 2018 Google 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 required by applicable law or agreed to in writing, ... | [
"firebase_admin._utils.handle_platform_error_from_requests",
"re.compile",
"firebase_admin._utils.get_app_service",
"time.sleep",
"firebase_admin.exceptions.DeadlineExceededError",
"base64.standard_b64decode",
"firebase_admin.exceptions.UnknownError"
] | [((1016, 1105), 'firebase_admin._utils.get_app_service', '_utils.get_app_service', (['app', '_PROJECT_MANAGEMENT_ATTRIBUTE', '_ProjectManagementService'], {}), '(app, _PROJECT_MANAGEMENT_ATTRIBUTE,\n _ProjectManagementService)\n', (1038, 1105), False, 'from firebase_admin import _utils\n'), ((12916, 12947), 're.comp... |
"""
********************************************************************************
* Name: spatial_reference.py
* Author: nswain
* Created On: May 15, 2018
* Copyright: (c) Aquaveo 2018
********************************************************************************
"""
from tethys_sdk.testing import TethysTestCase
f... | [
"tethysext.atcore.urls.spatial_reference.urls"
] | [((2227, 2278), 'tethysext.atcore.urls.spatial_reference.urls', 'spatial_reference.urls', (['MockUrlMapMaker', 'None', 'None'], {}), '(MockUrlMapMaker, None, None)\n', (2249, 2278), False, 'from tethysext.atcore.urls import spatial_reference\n'), ((2496, 2586), 'tethysext.atcore.urls.spatial_reference.urls', 'spatial_r... |
import pandas as pd, requests, yaml
pd.set_option('display.max_colwidth', None)
# Sysmon Linux events
sysmon_events = [1,3,4,5,9,11,16,23]
# Defining difference list to store data
difference_list = []
for event in sysmon_events:
# Getting OSSEM dictionaries data
url_sysmon_linux = 'https://raw.githubusercontent... | [
"pandas.DataFrame",
"requests.get",
"pandas.set_option"
] | [((36, 79), 'pandas.set_option', 'pd.set_option', (['"""display.max_colwidth"""', 'None'], {}), "('display.max_colwidth', None)\n", (49, 79), True, 'import pandas as pd, requests, yaml\n'), ((1807, 1836), 'pandas.DataFrame', 'pd.DataFrame', (['difference_list'], {}), '(difference_list)\n', (1819, 1836), True, 'import p... |
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import abc
import base64
import json
import time
from uuid import uuid4
import six
from msal import TokenCache
from azure.core.pipeline.policies import ContentDecodePo... | [
"base64.urlsafe_b64encode",
"abc.ABCMeta",
"json.dumps",
"azure.core.credentials.AccessToken",
"uuid.uuid4",
"azure.core.exceptions.ClientAuthenticationError",
"azure.core.pipeline.policies.ContentDecodePolicy.deserialize_from_http_generics",
"azure.core.pipeline.transport.HttpRequest",
"msal.TokenC... | [((9956, 10031), 'azure.core.exceptions.ClientAuthenticationError', 'ClientAuthenticationError', ([], {'message': 'message', 'response': 'response.http_response'}), '(message=message, response=response.http_response)\n', (9981, 10031), False, 'from azure.core.exceptions import ClientAuthenticationError\n'), ((767, 815)... |
# -*- coding: utf-8 -*-
#
# Copyright 2018 <NAME>. 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 ... | [
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.Sequential",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"matplotli... | [((888, 957), 'tensorflow.keras.preprocessing.sequence.pad_sequences', 'tf.keras.preprocessing.sequence.pad_sequences', (['train_data'], {'maxlen': '(256)'}), '(train_data, maxlen=256)\n', (933, 957), True, 'import tensorflow as tf\n'), ((970, 1038), 'tensorflow.keras.preprocessing.sequence.pad_sequences', 'tf.keras.pr... |
# Generated by Django 2.1.3 on 2019-12-09 14:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bearing', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='product',
name='ingredients',
... | [
"django.db.models.TextField"
] | [((329, 362), 'django.db.models.TextField', 'models.TextField', ([], {'default': '"""blank"""'}), "(default='blank')\n", (345, 362), False, 'from django.db import migrations, models\n')] |
"""
Location admin
"""
from django.contrib import admin
from .models import Location
# Register your models here.
admin.site.register(Location)
| [
"django.contrib.admin.site.register"
] | [((116, 145), 'django.contrib.admin.site.register', 'admin.site.register', (['Location'], {}), '(Location)\n', (135, 145), False, 'from django.contrib import admin\n')] |
import time
from abc import ABC
from os.path import getsize
from control.dispatcher import IDispatcher
from model import File
class BaseDispatcher(ABC, IDispatcher):
"""
"""
TRANSFER_DATA_POLL = 0.5
def execute(self, file: File) -> None:
"""
DO NOT EDIT OR OVERRIDE THIS METHOD
... | [
"os.path.getsize",
"time.sleep"
] | [((1309, 1331), 'os.path.getsize', 'getsize', (['file.filename'], {}), '(file.filename)\n', (1316, 1331), False, 'from os.path import getsize\n'), ((1352, 1374), 'os.path.getsize', 'getsize', (['file.filename'], {}), '(file.filename)\n', (1359, 1374), False, 'from os.path import getsize\n'), ((1387, 1408), 'time.sleep'... |
# -*- coding: utf-8 -*-
import unittest
from localstack.constants import APPLICATION_AMZ_JSON_1_1
from localstack.utils.aws import aws_stack
from localstack.utils import testutil
from localstack.utils.common import short_uid, retry
from localstack.services.awslambda.lambda_api import LAMBDA_RUNTIME_PYTHON36, func_arn
f... | [
"localstack.utils.testutil.create_lambda_function",
"localstack.services.awslambda.lambda_api.func_arn",
"localstack.utils.common.retry",
"localstack.utils.common.short_uid",
"localstack.utils.aws.aws_stack.connect_to_service",
"localstack.utils.testutil.get_lambda_log_events"
] | [((516, 552), 'localstack.utils.aws.aws_stack.connect_to_service', 'aws_stack.connect_to_service', (['"""logs"""'], {}), "('logs')\n", (544, 552), False, 'from localstack.utils.aws import aws_stack\n'), ((3220, 3258), 'localstack.utils.aws.aws_stack.connect_to_service', 'aws_stack.connect_to_service', (['"""lambda"""']... |
from serif.theory.event_mention import EventMention
from serif.theory.parse import Parse
from serif.theory.serif_sequence_theory import SerifSequenceTheory
from serif.xmlio import _SimpleAttribute, _ReferenceAttribute, _ChildTheoryElementList
from serif.theory.enumerated_type import Genericity,Polarity,Tense,Modality
... | [
"serif.theory.event_mention.EventMention",
"serif.xmlio._SimpleAttribute",
"serif.xmlio._ChildTheoryElementList",
"serif.xmlio._ReferenceAttribute"
] | [((378, 401), 'serif.xmlio._SimpleAttribute', '_SimpleAttribute', (['float'], {}), '(float)\n', (394, 401), False, 'from serif.xmlio import _SimpleAttribute, _ReferenceAttribute, _ChildTheoryElementList\n'), ((414, 456), 'serif.xmlio._ReferenceAttribute', '_ReferenceAttribute', (['"""parse_id"""'], {'cls': 'Parse'}), "... |
"""Test cases for converting kernels to product kernels in quad."""
import pytest
from probnum.quad.kernel_embeddings._matern_lebesgue import _convert_to_product_matern
from probnum.randprocs.kernels import Matern
def test_product_kernel_conversion_matern():
kernel = Matern(input_shape=(1,))
product_kernel ... | [
"probnum.quad.kernel_embeddings._matern_lebesgue._convert_to_product_matern",
"pytest.raises",
"probnum.randprocs.kernels.Matern"
] | [((276, 300), 'probnum.randprocs.kernels.Matern', 'Matern', ([], {'input_shape': '(1,)'}), '(input_shape=(1,))\n', (282, 300), False, 'from probnum.randprocs.kernels import Matern\n'), ((322, 356), 'probnum.quad.kernel_embeddings._matern_lebesgue._convert_to_product_matern', '_convert_to_product_matern', (['kernel'], {... |
# -*- coding: utf-8 -*-
from django.forms.models import ModelForm
from django.utils import simplejson
from django.forms import ModelChoiceField, Field
from django.forms.fields import CharField, IntegerField
from django.forms.forms import ValidationError
from django.utils.safestring import mark_safe
from django.contrib.... | [
"django.contrib.auth.models.User.objects.all",
"django.utils.simplejson.dumps"
] | [((983, 1001), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (999, 1001), False, 'from django.contrib.auth.models import User\n'), ((881, 923), 'django.utils.simplejson.dumps', 'simplejson.dumps', (['self'], {'cls': 'ExtJSONEncoder'}), '(self, cls=ExtJSONEncoder)\n', (897, 923), F... |
import socket
import threading
from queue import Queue
target = "192.168.254.49"
queue = Queue()
open_ports = []
def port_scan(port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target, port))
return True
except:
return False
#print(port_scan(443))
... | [
"threading.Thread",
"queue.Queue",
"socket.socket"
] | [((91, 98), 'queue.Queue', 'Queue', ([], {}), '()\n', (96, 98), False, 'from queue import Queue\n'), ((897, 928), 'threading.Thread', 'threading.Thread', ([], {'target': 'worker'}), '(target=worker)\n', (913, 928), False, 'import threading\n'), ((158, 207), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.... |
from django import forms
class FileUpload(forms.Form):
upload_file = forms.FileField() | [
"django.forms.FileField"
] | [((74, 91), 'django.forms.FileField', 'forms.FileField', ([], {}), '()\n', (89, 91), False, 'from django import forms\n')] |
from tweepy import API
from app.harvesters.twitter.tweets import Tweets
class TwitterHarvester():
def __init__(self, api: API, screen_name: str, last_tweet_id: str):
self.api = api
self.screen_name = screen_name
self.last_tweet_id = last_tweet_id
def fetch(self):
# retrieved_... | [
"app.harvesters.twitter.tweets.Tweets"
] | [((557, 634), 'app.harvesters.twitter.tweets.Tweets', 'Tweets', (['self.api', 'self.screen_name', 'self.last_tweet_id'], {'tweet_type': 'tweet_type'}), '(self.api, self.screen_name, self.last_tweet_id, tweet_type=tweet_type)\n', (563, 634), False, 'from app.harvesters.twitter.tweets import Tweets\n')] |
from __future__ import print_function, unicode_literals
import unittest
unittest.defaultTestLoader.testMethodPrefix = 'should'
try:
import unittest.mock as mock
except ImportError: # pragma: no cover
import mock
mock.patch.TEST_PREFIX = 'should'
import pyfakefs.fake_filesystem_unittest as fs_unittest
import os
import... | [
"mimetypes.guess_type",
"os.linesep.encode",
"mock.patch",
"mock.call"
] | [((2814, 2866), 'mock.patch', 'mock.patch', (['"""clckwrkbdgr.webserver.base_log_message"""'], {}), "('clckwrkbdgr.webserver.base_log_message')\n", (2824, 2866), False, 'import mock\n'), ((1750, 1787), 'mimetypes.guess_type', 'mimetypes.guess_type', (['"""/data/file.md"""'], {}), "('/data/file.md')\n", (1770, 1787), Fa... |
# -*- coding: utf-8 -*-
# Copyright 2015 Cyan, Inc.
# Copyright 2017, 2018 Ciena Corporation.
import struct
import unittest
import afkak.common
from afkak import _util as util
from afkak.common import BufferUnderflowError
class TestUtil(unittest.TestCase):
def test_write_int_string(self):
self.assertEqu... | [
"afkak._util.read_short_bytes",
"afkak._util.relative_unpack",
"afkak._util.read_int_string",
"afkak._util.write_short_bytes",
"afkak._util.write_int_string",
"afkak._util.group_by_topic_and_partition"
] | [((336, 373), 'afkak._util.write_int_string', 'util.write_int_string', (["b'some string'"], {}), "(b'some string')\n", (357, 373), True, 'from afkak import _util as util\n'), ((512, 538), 'afkak._util.write_int_string', 'util.write_int_string', (["b''"], {}), "(b'')\n", (533, 538), True, 'from afkak import _util as uti... |
import unittest
import sys
sys.path.insert(0,'..')
import numpy as np
from parampy import Parameters
from qubricks import Operator
from qubricks.wall import SpinBasis, SimpleBasis
class TestBasis(unittest.TestCase):
def setUp(self):
self.b = SpinBasis(dim=2**3)
def test_properties(self):
self.assertEqual(sel... | [
"sys.path.insert",
"qubricks.wall.SimpleBasis",
"numpy.sqrt",
"qubricks.wall.SpinBasis",
"qubricks.Operator",
"parampy.Parameters",
"numpy.array"
] | [((27, 51), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (42, 51), False, 'import sys\n'), ((249, 270), 'qubricks.wall.SpinBasis', 'SpinBasis', ([], {'dim': '(2 ** 3)'}), '(dim=2 ** 3)\n', (258, 270), False, 'from qubricks.wall import SpinBasis, SimpleBasis\n'), ((1291, 1303), 'paramp... |
import numpy as np
from rubin_sim.photUtils import Bandpass
__all__ = ["getImsimFluxNorm"]
def getImsimFluxNorm(sed, magmatch):
"""
Calculate the flux normalization of an SED in the imsim bandpass.
Parameters
-----------
sed is the SED to be normalized
magmatch is the desired magnitude in ... | [
"numpy.where",
"rubin_sim.photUtils.Bandpass",
"numpy.interp",
"numpy.power"
] | [((1672, 1697), 'numpy.power', 'np.power', (['(10)', '(-0.4 * dmag)'], {}), '(10, -0.4 * dmag)\n', (1680, 1697), True, 'import numpy as np\n'), ((897, 907), 'rubin_sim.photUtils.Bandpass', 'Bandpass', ([], {}), '()\n', (905, 907), False, 'from rubin_sim.photUtils import Bandpass\n'), ((958, 979), 'numpy.where', 'np.whe... |
from enum import Enum
from typing import Optional, Tuple, Union
import scipy.sparse
import torch
class SparseType(Enum):
"""Whether a `SparseTensor` is in CSC or CSR format.
"""
CSR = "csr"
CSC = "csc"
def __str__(self):
return self.value
def __repr__(self):
return str(self)... | [
"torch.from_numpy"
] | [((8189, 8215), 'torch.from_numpy', 'torch.from_numpy', (['mat.data'], {}), '(mat.data)\n', (8205, 8215), False, 'import torch\n'), ((8544, 8570), 'torch.from_numpy', 'torch.from_numpy', (['mat.data'], {}), '(mat.data)\n', (8560, 8570), False, 'import torch\n'), ((8055, 8083), 'torch.from_numpy', 'torch.from_numpy', ([... |
from abc import ABC
from pathlib import Path
from collections import defaultdict
import random
import numpy as np
from enum import Enum
import torch
from torch.utils.data import Dataset, DataLoader
import MinkowskiEngine as ME
from plyfile import PlyData
import lib.transforms as t
from lib.dataloader import InfSamp... | [
"lib.transforms.ChromaticTranslation",
"lib.transforms.ChromaticJitter",
"numpy.hstack",
"torch.utils.data.DataLoader",
"numpy.array",
"lib.transforms.RandomDropout",
"lib.transforms.cflt_collate_fn_factory",
"lib.voxelizer.Voxelizer",
"lib.dataloader.InfSampler",
"pathlib.Path",
"numpy.vstack",... | [((15582, 15605), 'torch.utils.data.DataLoader', 'DataLoader', ([], {}), '(**data_args)\n', (15592, 15605), False, 'from torch.utils.data import Dataset, DataLoader\n'), ((2008, 2030), 'torch.utils.data.Dataset.__init__', 'Dataset.__init__', (['self'], {}), '(self)\n', (2024, 2030), False, 'from torch.utils.data import... |
"""
todo helpers
"""
# -*- coding: UTF-8 -*-
import os
import re
from random import randrange
from .const_value import TODO_HEADER, ACTIONS
def filter_complete_todos(todo):
re_result = re.search(r'^{}~~(.*)~~\n$'.format(TODO_HEADER), todo)
result = True if re_result else False
return result
def filter_target_tod... | [
"os.path.isfile",
"os.listdir"
] | [((925, 952), 'os.listdir', 'os.listdir', (['"""icons/default"""'], {}), "('icons/default')\n", (935, 952), False, 'import os\n'), ((776, 801), 'os.path.isfile', 'os.path.isfile', (['icon_path'], {}), '(icon_path)\n', (790, 801), False, 'import os\n')] |
import glob
import os
import numpy as np
from yt.data_objects.static_output import ParticleDataset
from yt.frontends.halo_catalog.data_structures import HaloCatalogFile
from yt.funcs import setdefaultattr
from yt.geometry.particle_geometry_handler import ParticleIndex
from yt.utilities import fortran_utils as fpu
fro... | [
"yt.utilities.fortran_utils.read_cattrs",
"numpy.fromfile",
"numpy.ones",
"numpy.array",
"numpy.empty",
"yt.utilities.cosmology.Cosmology",
"yt.funcs.setdefaultattr",
"glob.glob"
] | [((1160, 1198), 'numpy.empty', 'np.empty', (['(pcount, 3)'], {'dtype': '"""float64"""'}), "((pcount, 3), dtype='float64')\n", (1168, 1198), True, 'import numpy as np\n'), ((1266, 1318), 'numpy.fromfile', 'np.fromfile', (['f'], {'dtype': 'self.io._halo_dt', 'count': 'pcount'}), '(f, dtype=self.io._halo_dt, count=pcount)... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ˅
from behavioral_patterns.interpreter.node import Node
from behavioral_patterns.interpreter.command import Command
# ˄
class CommandList(Node):
# ˅
# ˄
def __init__(self):
self.__nodes = []
# ˅
pass
# ˄
def parse(se... | [
"behavioral_patterns.interpreter.command.Command"
] | [((604, 613), 'behavioral_patterns.interpreter.command.Command', 'Command', ([], {}), '()\n', (611, 613), False, 'from behavioral_patterns.interpreter.command import Command\n')] |
#from Instrucciones.instruccion import Instruccion
from Analisis_Ascendente.Instrucciones.instruccion import Instruccion
#from storageManager.jsonMode import *
from Analisis_Ascendente.storageManager.jsonMode import *
#import Tabla_simbolos.TablaSimbolos as ts
import Analisis_Ascendente.Tabla_simbolos.TablaSimbolos as ... | [
"C3D.GeneradorTemporales.nuevo_temporal"
] | [((2914, 2950), 'C3D.GeneradorTemporales.nuevo_temporal', 'GeneradorTemporales.nuevo_temporal', ([], {}), '()\n', (2948, 2950), True, 'import C3D.GeneradorTemporales as GeneradorTemporales\n')] |
#!/usr/bin/python3
if __name__ == '__main__':
from gitrsync.__main__ import main
main()
| [
"gitrsync.__main__.main"
] | [((91, 97), 'gitrsync.__main__.main', 'main', ([], {}), '()\n', (95, 97), False, 'from gitrsync.__main__ import main\n')] |
from fastapi import FastAPI
from pytest import fixture
from fastapi_pagination import LimitOffsetPage, Page, add_pagination, paginate
from .base import BasePaginationTestCase, SafeTestClient, UserOut
from .utils import faker
app = FastAPI()
entities = [UserOut(name=faker.name()) for _ in range(100)]
@app.get("/de... | [
"fastapi_pagination.add_pagination",
"pytest.fixture",
"fastapi.FastAPI",
"fastapi_pagination.paginate"
] | [((234, 243), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (241, 243), False, 'from fastapi import FastAPI\n'), ((476, 495), 'fastapi_pagination.add_pagination', 'add_pagination', (['app'], {}), '(app)\n', (490, 495), False, 'from fastapi_pagination import LimitOffsetPage, Page, add_pagination, paginate\n'), ((455, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: <NAME> <<EMAIL>>, <<EMAIL>>
# author: <NAME> <<EMAIL>>
import json
import urllib.request
from urllib.parse import urlparse
from collections import OrderedDict
import boto3
import tabulate
from ruamel.yaml import YAML
def getTemplateText(file_url):
try:
... | [
"tabulate.tabulate",
"collections.OrderedDict",
"urllib.parse.urlparse",
"json.dumps",
"ruamel.yaml.YAML",
"boto3.resource"
] | [((2711, 2724), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2722, 2724), False, 'from collections import OrderedDict\n'), ((5724, 5730), 'ruamel.yaml.YAML', 'YAML', ([], {}), '()\n', (5728, 5730), False, 'from ruamel.yaml import YAML\n'), ((1978, 1991), 'collections.OrderedDict', 'OrderedDict', ([], {}... |
from typing import List, Tuple, Union, Any
import numpy as np
from collections import defaultdict
import itertools
import matplotlib.pyplot as plt
T_untokenized = Union[List[str], Tuple[List[str], List[Any]]]
def untokenize(raw: str, tokens: List[str],
return_mask: bool = False,
toke... | [
"numpy.ones_like",
"numpy.exp",
"numpy.array",
"itertools.chain.from_iterable",
"collections.defaultdict",
"matplotlib.pyplot.get_cmap"
] | [((5128, 5147), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['"""bwr"""'], {}), "('bwr')\n", (5140, 5147), True, 'import matplotlib.pyplot as plt\n'), ((2877, 2900), 'numpy.array', 'np.array', (['self.as_list_'], {}), '(self.as_list_)\n', (2885, 2900), True, 'import numpy as np\n'), ((4767, 4804), 'numpy.ones_like',... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import itertools
import posixpath
from urllib.parse import urlparse
from flask import current_app, g, ren... | [
"flask.render_template",
"indico.web.flask.templating.get_template_module",
"itertools.chain",
"indico.web.util.jsonify_template",
"posixpath.join",
"urllib.parse.urlparse",
"indico.util.i18n._",
"flask.g.get",
"indico.web.flask.util.url_for",
"indico.web.menu.build_menu_structure",
"flask.sessi... | [((1300, 1332), 'indico.web.menu.build_menu_structure', 'build_menu_structure', (['"""top-menu"""'], {}), "('top-menu')\n", (1320, 1332), False, 'from indico.web.menu import build_menu_structure\n'), ((1344, 1518), 'flask.render_template', 'render_template', (['"""header.html"""'], {'category': 'category', 'top_menu_it... |
from flask import Flask, render_template, request, redirect, url_for
import json
from urllib.request import urlopen
import sys
app = Flask(__name__)
# ** ---------------------------------------------------- ** #
# First of All subscribe here, To get an API key :
# https://free.currencyconverterapi.com/free-api-key... | [
"json.loads",
"sys.exit",
"urllib.request.urlopen",
"flask.Flask"
] | [((136, 151), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'from flask import Flask, render_template, request, redirect, url_for\n'), ((1640, 1658), 'json.loads', 'json.loads', (['source'], {}), '(source)\n', (1650, 1658), False, 'import json\n'), ((1198, 1209), 'sys.exit', 'sys.exit',... |
import FWCore.ParameterSet.Config as cms
import os
from Configuration.Eras.Era_Phase2C9_cff import Phase2C9
process = cms.Process('CLIENT',Phase2C9)
process.load("Configuration.StandardSequences.Reconstruction_cff")
process.load('Configuration.Geometry.GeometryExtended2026D46Reco_cff')
process.load('Configuration.Geo... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.string",
"os.environ.get",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Co... | [((119, 150), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""CLIENT"""', 'Phase2C9'], {}), "('CLIENT', Phase2C9)\n", (130, 150), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1616, 1643), 'FWCore.ParameterSet.Config.untracked.string', 'cms.untracked.string', (['"""all"""'], {}), "('all')\n", (1636,... |
"""
Build an electrophysiological dataset
=====================================
In Frites, a dataset is a structure for grouping the electrophysiological data
(e.g MEG / EEG / Intracranial) coming from multiple subjects. In addition,
some basic operations can also be performed (like slicing, smoothing etc.). In
this e... | [
"numpy.random.rand",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((1592, 1630), 'matplotlib.pyplot.plot', 'plt.plot', (['dt.times', 'dt.x[0][:, 0, :].T'], {}), '(dt.times, dt.x[0][:, 0, :].T)\n', (1600, 1630), True, 'import matplotlib.pyplot as plt\n'), ((1631, 1650), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Times"""'], {}), "('Times')\n", (1641, 1650), True, 'import matplot... |
"""
SiliconLife Eyeflow
Function to run a flow at edge
Author: <NAME>
"""
import os
import traceback
import sys
import argparse
from eyeflow_sdk import edge_client
# import edge_client
import tensorflow as tf
os.environ["CONF_PATH"] = os.path.dirname(__file__)
from eyeflow_sdk.log_obj import CONFIG, log
import fl... | [
"utils.upload_flow_extracts",
"utils.get_flow_components",
"flow_run.ImageSave",
"argparse.ArgumentParser",
"utils.prepare_models",
"eyeflow_sdk.log_obj.log.error",
"flow_run.VideoSave",
"flow_run.FlowRun",
"eyeflow_sdk.log_obj.log.info",
"os.path.dirname",
"utils.check_license",
"utils.get_li... | [((239, 264), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (254, 264), False, 'import os\n'), ((557, 611), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Process a flow."""'}), "(description='Process a flow.')\n", (580, 611), False, 'import argparse\n'), ((11... |
#
# Copyright (C) 2012 - 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: MIT
#
# pylint: disable=missing-docstring, invalid-name
import pathlib
import unittest
import anyconfig.backend.json
import anyconfig.backend.json.default as JSON
try:
import anyconfig.backend.yaml.pyyaml as PYYAML
except ImportError:
P... | [
"anyconfig.parsers.parsers.Parsers",
"pathlib.Path"
] | [((632, 644), 'anyconfig.parsers.parsers.Parsers', 'TT.Parsers', ([], {}), '()\n', (642, 644), True, 'import anyconfig.parsers.parsers as TT\n'), ((1804, 1826), 'pathlib.Path', 'pathlib.Path', (['"""x.json"""'], {}), "('x.json')\n", (1816, 1826), False, 'import pathlib\n')] |
import os
import astropy.constants as const
import astropy.units as u
import numpy as np
from astropy.coordinates import GCRS, ITRS, SkyOffsetFrame, SkyCoord, EarthLocation, Angle, get_sun
from astropy.time import Time
from sora.config import input_tests
__all__ = ['plot_occ_map']
def xy2latlon(x, y, loncen, latce... | [
"astropy.coordinates.EarthLocation",
"numpy.sqrt",
"astropy.coordinates.GCRS",
"astropy.coordinates.get_sun",
"sora.config.input_tests.check_kwargs",
"numpy.array",
"numpy.arctan2",
"astropy.constants.R_earth.to",
"numpy.sin",
"numpy.arange",
"os.path.exists",
"numpy.repeat",
"astropy.coordi... | [((1032, 1077), 'astropy.coordinates.EarthLocation', 'EarthLocation', (['(loncen * u.deg)', '(latcen * u.deg)'], {}), '(loncen * u.deg, latcen * u.deg)\n', (1045, 1077), False, 'from astropy.coordinates import GCRS, ITRS, SkyOffsetFrame, SkyCoord, EarthLocation, Angle, get_sun\n'), ((1187, 1207), 'numpy.array', 'np.arr... |
import logging
import os
from dvc.repo import locked
from dvc.repo.scm_context import scm_context
from dvc.scm.base import RevError
from dvc.utils.fs import remove
from .base import (
EXEC_APPLY,
ApplyConflictError,
BaselineMismatchError,
InvalidExpRevError,
)
from .executor.base import BaseExecutor
... | [
"logging.getLogger",
"os.path.exists",
"os.path.join",
"dvc.utils.fs.remove",
"dvc.repo.checkout.checkout"
] | [((329, 356), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (346, 356), False, 'import logging\n'), ((2150, 2178), 'dvc.repo.checkout.checkout', 'dvc_checkout', (['repo'], {}), '(repo, **kwargs)\n', (2162, 2178), True, 'from dvc.repo.checkout import checkout as dvc_checkout\n'), ((2019, ... |
# calculation of time (in seconds) that elapsed between the stimulation is applied and the VAS
# score is register
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# set path
path = '../data/data_sub.xlsx'
dataFrame = pd.read_excel(path, header=2, sheet_name='trials_noTime'... | [
"numpy.mean",
"numpy.median",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"pandas.read_excel",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"seaborn.swarmplot"
] | [((264, 321), 'pandas.read_excel', 'pd.read_excel', (['path'], {'header': '(2)', 'sheet_name': '"""trials_noTime"""'}), "(path, header=2, sheet_name='trials_noTime')\n", (277, 321), True, 'import pandas as pd\n'), ((10273, 10286), 'matplotlib.pyplot.figure', 'plt.figure', (['(2)'], {}), '(2)\n', (10283, 10286), True, '... |
import os
from keras.datasets import mnist
from autokeras.image.image_supervised import ImageClassifier
from autokeras.utils import pickle_from_file
from graphviz import Digraph
def to_pdf(graph, path):
dot = Digraph(comment='The Round Table')
for index, node in enumerate(graph.node_list):
dot.node(s... | [
"graphviz.Digraph",
"autokeras.image.image_supervised.ImageClassifier",
"os.path.join",
"keras.datasets.mnist.load_data"
] | [((215, 249), 'graphviz.Digraph', 'Digraph', ([], {'comment': '"""The Round Table"""'}), "(comment='The Round Table')\n", (222, 249), False, 'from graphviz import Digraph\n'), ((959, 976), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()\n', (974, 976), False, 'from keras.datasets import mnist\n'), ((... |
from setuptools import setup
with open("/Users/gsp/Desktop/Data science/Udacity data science /Lessons/Python code/Object oriented programming/mplot/README.md", "r") as fh:
long_description = fh.read()
setup(
name = 'mplot_plots',
version = '1.1',
description = 'Diagnostic plots for linear model',
py_modules = [... | [
"setuptools.setup"
] | [((205, 793), 'setuptools.setup', 'setup', ([], {'name': '"""mplot_plots"""', 'version': '"""1.1"""', 'description': '"""Diagnostic plots for linear model"""', 'py_modules': "['mplot']", 'package_dir': "{'': 'mplot_plots'}", 'classifiers': "['Programming Language :: Python :: 3',\n 'Programming Language :: Python ::... |
# Copyright 2018, <NAME>
#
# 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 copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redis... | [
"traceback.format_exc",
"json.loads",
"importlib.import_module",
"inspect.currentframe",
"os.path.isfile",
"os.path.dirname",
"pydevd.stoptrace",
"os.path.basename",
"importlib.reload",
"os.path.abspath",
"traceback.print_exc",
"sys.path.append"
] | [((2218, 2246), 'os.path.dirname', 'os.path.dirname', (['script_path'], {}), '(script_path)\n', (2233, 2246), False, 'import os\n'), ((2115, 2137), 'inspect.currentframe', 'inspect.currentframe', ([], {}), '()\n', (2135, 2137), False, 'import inspect\n'), ((2171, 2200), 'os.path.basename', 'os.path.basename', (['script... |
# Python-bioformats is distributed under the GNU General Public
# License, but this file is licensed under the more permissive BSD
# license. See the accompanying file LICENSE for details.
#
# Copyright (c) 2009-2014 Broad Institute
# All rights reserved.
''' metadatatools.py - mechanism to wrap some bioformats metad... | [
"javabridge.jutil.get_static_field",
"javabridge.jutil.call",
"javabridge.jutil.get_env",
"javabridge.jutil.static_call",
"javabridge.jutil.make_method",
"javabridge.jutil.make_instance"
] | [((662, 772), 'javabridge.jutil.static_call', 'jutil.static_call', (['"""loci/formats/MetadataTools"""', '"""createOMEXMLMetadata"""', '"""()Lloci/formats/meta/IMetadata;"""'], {}), "('loci/formats/MetadataTools', 'createOMEXMLMetadata',\n '()Lloci/formats/meta/IMetadata;')\n", (679, 772), False, 'from javabridge im... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import torch
class SGDW(torch.optim.SGD):
"""
Decoupled Weight Decay Regularization
reference: https://arxiv.org/abs/1711.05101
"""
def step(self, closure=None):
"""Performs a single optimization step.
Arguments:
... | [
"torch.zeros_like"
] | [((1139, 1163), 'torch.zeros_like', 'torch.zeros_like', (['p.data'], {}), '(p.data)\n', (1155, 1163), False, 'import torch\n')] |
from modeltranslation.translator import translator, TranslationOptions
from .models import Country
class CountryTranslationOptions(TranslationOptions):
fields = ('name',)
translator.register(Country, CountryTranslationOptions)
| [
"modeltranslation.translator.translator.register"
] | [((179, 234), 'modeltranslation.translator.translator.register', 'translator.register', (['Country', 'CountryTranslationOptions'], {}), '(Country, CountryTranslationOptions)\n', (198, 234), False, 'from modeltranslation.translator import translator, TranslationOptions\n')] |
from typing import Tuple, Optional
from ..ast import StructuredStatement, Term, Metavariable, Application
from ..composer import Composer, Theorem, MethodAutoProof, Proof
from ..utils import MetamathUtils
from .notation import NotationProver
import ml.metamath.auto as auto
class PositiveProver:
"""
Prove s... | [
"ml.metamath.auto.typecode.TypecodeProver.prove_typecode"
] | [((4072, 4144), 'ml.metamath.auto.typecode.TypecodeProver.prove_typecode', 'auto.typecode.TypecodeProver.prove_typecode', (['composer', '"""#Variable"""', 'term'], {}), "(composer, '#Variable', term)\n", (4115, 4144), True, 'import ml.metamath.auto as auto\n'), ((4253, 4323), 'ml.metamath.auto.typecode.TypecodeProver.p... |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | [
"devtools_testutils.RandomNameResourceGroupPreparer",
"os.getenv"
] | [((2540, 2596), 'devtools_testutils.RandomNameResourceGroupPreparer', 'RandomNameResourceGroupPreparer', ([], {'location': 'AZURE_LOCATION'}), '(location=AZURE_LOCATION)\n', (2571, 2596), False, 'from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy\n'), ((2449, 24... |
# Copyright 2020 The Magenta 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 applicable law or agreed to in ... | [
"model.Model",
"tensorflow.compat.v1.disable_v2_behavior",
"zipfile.ZipFile",
"model.copy_hparams",
"tensorflow.compat.v1.get_default_session",
"tensorflow.compat.v1.summary.Summary",
"tensorflow.compat.v1.global_variables_initializer",
"model.get_default_hparams",
"tensorflow.compat.v1.logging.set_... | [((857, 898), 'tensorflow.compat.v1.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (881, 898), True, 'import tensorflow.compat.v1 as tf\n'), ((928, 1211), 'tensorflow.compat.v1.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""data_dir"""', '"""https://... |
try:
import serene
except ImportError as e:
import sys
sys.path.insert(0, '.')
import serene
from serene.matcher.core import SchemaMatcher
import os.path
#
# First setup the example dataset path...
#
EXAMPLE_DATASET = os.path.join('../tests', 'resources', 'medium.csv')
# connect to the server...
# ho... | [
"serene.matcher.core.SchemaMatcher",
"sys.path.insert"
] | [((388, 430), 'serene.matcher.core.SchemaMatcher', 'SchemaMatcher', ([], {'host': '"""localhost"""', 'port': '(8080)'}), "(host='localhost', port=8080)\n", (401, 430), False, 'from serene.matcher.core import SchemaMatcher\n'), ((67, 90), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""."""'], {}), "(0, '.')\n", (82,... |
from ..dojo_test_case import DojoTestCase
from dojo.models import Test
from dojo.tools.netsparker.parser import NetsparkerParser
class TestNetsparkerParser(DojoTestCase):
def test_parse_file_with_one_finding(self):
testfile = open("unittests/scans/netsparker/netsparker_one_finding.json")
parser =... | [
"dojo.models.Test",
"dojo.tools.netsparker.parser.NetsparkerParser"
] | [((321, 339), 'dojo.tools.netsparker.parser.NetsparkerParser', 'NetsparkerParser', ([], {}), '()\n', (337, 339), False, 'from dojo.tools.netsparker.parser import NetsparkerParser\n'), ((1389, 1407), 'dojo.tools.netsparker.parser.NetsparkerParser', 'NetsparkerParser', ([], {}), '()\n', (1405, 1407), False, 'from dojo.to... |
"""
Aggregate tools
===============
"""
import sys
import numpy
from .._lib.hashmap import factorize
from ..compat import tqdm
from ..ds.scaling import linearscaling
from .arrays import first, lexsort_uint32_pair, to_structured
def igroupby(ids, values, n=None, logging_prefix=None, assume_sorted=False,
... | [
"numpy.unique",
"numpy.where",
"numpy.asarray",
"numpy.warnings.filterwarnings",
"numpy.iinfo",
"numpy.argsort",
"numpy.lexsort",
"numpy.warnings.catch_warnings",
"numpy.empty_like",
"numpy.empty",
"numpy.cumsum",
"numpy.full",
"numpy.bincount"
] | [((2130, 2148), 'numpy.asarray', 'numpy.asarray', (['ids'], {}), '(ids)\n', (2143, 2148), False, 'import numpy\n'), ((2162, 2183), 'numpy.asarray', 'numpy.asarray', (['values'], {}), '(values)\n', (2175, 2183), False, 'import numpy\n'), ((5163, 5187), 'numpy.full', 'numpy.full', (['length', 'init'], {}), '(length, init... |
import pyautogui
import PySimpleGUI as sg
import cv2
import numpy as np
"""
Demo program that displays a webcam using OpenCV
"""
def main():
sg.theme('Black')
# define the window layout
layout = [[sg.Text('OpenCV Demo', size=(40, 1), justification='center', font='Helvetica 20')],
[sg.Imag... | [
"cv2.imencode",
"pyautogui.screenshot",
"PySimpleGUI.Text",
"PySimpleGUI.Button",
"PySimpleGUI.theme",
"cv2.VideoCapture",
"PySimpleGUI.Image",
"numpy.full",
"PySimpleGUI.Window"
] | [((149, 166), 'PySimpleGUI.theme', 'sg.theme', (['"""Black"""'], {}), "('Black')\n", (157, 166), True, 'import PySimpleGUI as sg\n'), ((684, 763), 'PySimpleGUI.Window', 'sg.Window', (['"""Demo Application - OpenCV Integration"""', 'layout'], {'location': '(800, 400)'}), "('Demo Application - OpenCV Integration', layout... |
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20140907103315.18766: * @file ../plugins/qt_events.py
#@@first
'''Leo's Qt event handling code.'''
#@+<< about internal bindings >>
#@+node:ekr.20110605121601.18538: ** << about internal bindings >>
#@@nocolor-node
#@+at
#
# Here are the rules for translating key b... | [
"leo.core.leoQt.QtWidgets.QApplication.focusWidget",
"leo.core.leoGlobals.app.gui.onDeactivateEvent",
"leo.core.leoQt.QtCore.QObject.__init__",
"leo.core.leoGlobals.trace",
"leo.core.leoGlobals.app.gui.onActivateEvent",
"leo.core.leoGlobals.es_exception",
"leo.core.leoGlobals.u",
"leo.core.leoQt.QtGui... | [((1836, 1865), 'leo.core.leoQt.QtCore.QObject.__init__', 'QtCore.QObject.__init__', (['self'], {}), '(self)\n', (1859, 1865), False, 'from leo.core.leoQt import QtCore, QtGui, QtWidgets\n'), ((11170, 11179), 'leo.core.leoGlobals.u', 'g.u', (['text'], {}), '(text)\n', (11173, 11179), True, 'import leo.core.leoGlobals a... |
"""Copyright 2018 <NAME> and The Netherlands Organisation for
Applied Scientific Research TNO.
Licensed under the MIT license.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction,... | [
"configsuite.Transformer",
"collections.namedtuple",
"configsuite.Validator",
"copy.deepcopy"
] | [((3223, 3244), 'copy.deepcopy', 'copy.deepcopy', (['schema'], {}), '(schema)\n', (3236, 3244), False, 'import copy\n'), ((7225, 7312), 'configsuite.Transformer', 'configsuite.Transformer', (['self._schema', 'MK.LayerTransformation', '()'], {'bottom_up': '(False)'}), '(self._schema, MK.LayerTransformation, (), bottom_u... |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The ios_l3_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on ... | [
"ansible.module_utils.six.iteritems",
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils.remove_empties",
"ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils.validate_config",
"ansible_collections.cisco.ios.plugins.module_utils.network.ios.utils.utils... | [((1960, 1986), 'ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils.remove_empties', 'utils.remove_empties', (['objs'], {}), '(objs)\n', (1980, 1986), False, 'from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import utils\n'), ((2025, 2040), 'ansible.module_util... |
#
# @lc app=leetcode id=169 lang=python
#
# [169] Majority Element
#
# https://leetcode.com/problems/majority-element/description/
#
# algorithms
# Easy (56.44%)
# Total Accepted: 542.5K
# Total Submissions: 960.6K
# Testcase Example: '[3,2,3]'
#
# Given an array of size n, find the majority element. The majority e... | [
"collections.Counter"
] | [((1206, 1219), 'collections.Counter', 'Counter', (['nums'], {}), '(nums)\n', (1213, 1219), False, 'from collections import Counter\n')] |
""" opentrons.system.nmcli: Functions and data for interacting with nmcli
The functions contained here are for bridging Python calls with nmcli command
line invocations. They are in general not safe to call anywhere except an
Opentrons robot; on systems that do not have network-manager (like OSX, Windows
and some Linu... | [
"logging.getLogger",
"os.makedirs",
"re.compile",
"os.path.join",
"os.symlink",
"shlex.quote",
"copy.deepcopy",
"os.path.abspath",
"os.path.relpath",
"asyncio.subprocess.create_subprocess_shell",
"re.search"
] | [((892, 919), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (909, 919), False, 'import logging\n'), ((17587, 17659), 're.search', 're.search', (['"""Connection \'(.*)\'[\\\\s]+\\\\(([\\\\w\\\\d-]+)\\\\) successfully"""', 'res'], {}), '("Connection \'(.*)\'[\\\\s]+\\\\(([\\\\w\\\\d-]+)\\\... |
import datetime as dt
import json
import subprocess
import sys, os
import requests
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from os.path import expanduser
import logging
home = expanduser("~")
DAG_NAME = 'fraud_detec... | [
"logging.basicConfig",
"datetime.datetime",
"logging.getLogger",
"json.loads",
"airflow.operators.python_operator.PythonOperator",
"requests.get",
"airflow.operators.bash_operator.BashOperator",
"airflow.DAG",
"os.system",
"datetime.timedelta",
"os.path.expanduser"
] | [((280, 295), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (290, 295), False, 'from os.path import expanduser\n'), ((327, 385), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO'}), '(stream=sys.stdout, level=logging.INFO)\n', (346, 385), False, 'imp... |
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import os
import sys
import codecs
try:
from setuptools.core import setup, find_packages
except ImportError:
from setuptools import setup, find_packages
if sys.version_info < (2, 7):
raise SystemExit("Python 2.7 or later is required.... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join"
] | [((662, 687), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (677, 687), False, 'import os\n'), ((2925, 2995), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['bench', 'docs', 'example', 'test', 'htmlcov']"}), "(exclude=['bench', 'docs', 'example', 'test', 'htmlcov'])\n", (293... |
import six
from sklearn.pipeline import _name_estimators, Pipeline
from sklearn.utils import tosequence
def _call_fit(fit_method, X, y=None, **kwargs):
"""
helper function, calls the fit or fit_transform method with the correct
number of parameters
fit_method: fit or fit_transform method of the trans... | [
"six.iteritems",
"sklearn.pipeline._name_estimators",
"sklearn.utils.tosequence"
] | [((1455, 1472), 'sklearn.utils.tosequence', 'tosequence', (['steps'], {}), '(steps)\n', (1465, 1472), False, 'from sklearn.utils import tosequence\n'), ((2263, 2288), 'six.iteritems', 'six.iteritems', (['fit_params'], {}), '(fit_params)\n', (2276, 2288), False, 'import six\n'), ((3578, 3601), 'sklearn.pipeline._name_es... |
from tronapi.tron import Tron
tron = Tron('https://api.trongrid.io:8090')
tron.to_hex('TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8')
# result: 41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10
tron.from_hex('41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10')
# result: TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8
| [
"tronapi.tron.Tron"
] | [((38, 74), 'tronapi.tron.Tron', 'Tron', (['"""https://api.trongrid.io:8090"""'], {}), "('https://api.trongrid.io:8090')\n", (42, 74), False, 'from tronapi.tron import Tron\n')] |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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 required by applicabl... | [
"maas_common.get_auth_ref",
"maas_common.get_nova_client",
"maas_common.metric_bool",
"argparse.ArgumentParser",
"maas_common.print_output",
"maas_common.status_ok",
"maas_common.status_err"
] | [((788, 802), 'maas_common.get_auth_ref', 'get_auth_ref', ([], {}), '()\n', (800, 802), False, 'from maas_common import get_auth_ref, get_nova_client, status_err, status_ok, metric_bool, print_output\n'), ((1556, 1567), 'maas_common.status_ok', 'status_ok', ([], {}), '()\n', (1565, 1567), False, 'from maas_common impor... |
# Copyright 2018 The Cornac 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 applicable ... | [
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.is_available",
"torch.device"
] | [((4612, 4634), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0')\n", (4624, 4634), False, 'import torch\n'), ((4712, 4731), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (4724, 4731), False, 'import torch\n'), ((4668, 4693), 'torch.cuda.is_available', 'torch.cuda.is_available', ([... |
"""Initial migration
Revision ID: 01b39c33b171
Revises: None
Create Date: 2016-09-23 21:14:06.368989
"""
# revision identifiers, used by Alembic.
revision = '0<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ... | [
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.Float",
"alembic.op.drop_table",
"sqlalchemy.Boolean",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.String",
"sqlalchemy.BigInteger"
] | [((2298, 2328), 'alembic.op.drop_table', 'op.drop_table', (['"""user_features"""'], {}), "('user_features')\n", (2311, 2328), False, 'from alembic import op\n'), ((2333, 2357), 'alembic.op.drop_table', 'op.drop_table', (['"""reviews"""'], {}), "('reviews')\n", (2346, 2357), False, 'from alembic import op\n'), ((2362, 2... |
# Copyright 2020, OpenTelemetry 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 applicable law or agreed to i... | [
"logging.getLogger",
"importlib.import_module",
"functools.wraps",
"opentelemetry.trace.get_tracer",
"os.path.dirname",
"inspect.isclass",
"pkgutil.iter_modules"
] | [((2568, 2595), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2585, 2595), False, 'import logging\n'), ((3029, 3047), 'inspect.isclass', 'isclass', (['estimator'], {}), '(estimator)\n', (3036, 3047), False, 'from inspect import isclass\n'), ((3671, 3682), 'functools.wraps', 'wraps', (['... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('issues', '0013_auto_20150324_2220'),
]
operations = [
migrations.CreateModel(
name='GuestComment',
f... | [
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((351, 444), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'verbose_name': '"""ID"""', 'serialize': '(False)', 'primary_key': '(True)'}), "(auto_created=True, verbose_name='ID', serialize=False,\n primary_key=True)\n", (367, 444), False, 'from django.db import models, migrations\... |
# This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
"""
API for dataset indexing, access and search.
"""
import json
import logging
import warnings
from collections import namedtuple
from typing i... | [
"logging.getLogger",
"datacube.index.fields.to_expressions",
"json.loads",
"collections.namedtuple",
"uuid.UUID",
"sqlalchemy.func.min",
"datacube.utils._readable_offset",
"datacube.drivers.postgres._fields.SimpleDocField",
"datacube.model.fields.Field",
"sqlalchemy.func.max",
"datacube.model.ut... | [((943, 970), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (960, 970), False, 'import logging\n'), ((9365, 9411), 'datacube.utils.changes.classify_changes', 'changes.classify_changes', (['doc_changes', 'allowed'], {}), '(doc_changes, allowed)\n', (9389, 9411), False, 'from datacube.util... |