code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path as osp
class VisionaryDevTools(Package):
"""Developer convenience packages common to all visionary
... | [
"os.path.dirname"
] | [((3313, 3334), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (3324, 3334), True, 'import os.path as osp\n')] |
#usr/bin/env python
## useful imports
import time
import io
import os
import re
import sys
from sys import argv
import subprocess
## ARGV
if len (sys.argv) < 5:
print ("\nUsage:")
print ("python3 %s bam_file folder bedtools_bin samtools_bin logfile\n" %os.path.realpath(__file__))
exit()
bam_file = os.path.abspath... | [
"subprocess.check_output",
"os.path.isfile",
"os.path.dirname",
"os.path.realpath",
"os.path.basename",
"os.path.abspath"
] | [((305, 329), 'os.path.abspath', 'os.path.abspath', (['argv[1]'], {}), '(argv[1])\n', (320, 329), False, 'import os\n'), ((542, 567), 'os.path.dirname', 'os.path.dirname', (['bam_file'], {}), '(bam_file)\n', (557, 567), False, 'import os\n'), ((976, 1000), 'os.path.isfile', 'os.path.isfile', (['bed_file'], {}), '(bed_f... |
#!/usr/bin/env python3
from sys import stderr, exit, argv
from random import randrange
#from TALinputs import TALinput
from multilanguage import Env, Lang, TALcolors
# METADATA OF THIS TAL_SERVICE:
problem="tiling_mxn-boards_with_1x2-boards"
service="is_tilable"
args_list = [
('m',int),
('n',int),
('my_co... | [
"multilanguage.Env",
"sys.exit",
"multilanguage.TALcolors"
] | [((413, 445), 'multilanguage.Env', 'Env', (['problem', 'service', 'args_list'], {}), '(problem, service, args_list)\n', (416, 445), False, 'from multilanguage import Env, Lang, TALcolors\n'), ((451, 465), 'multilanguage.TALcolors', 'TALcolors', (['ENV'], {}), '(ENV)\n', (460, 465), False, 'from multilanguage import Env... |
import pytest
from jina.enums import RemoteAccessType
from jina.flow import Flow
from jina.parser import set_pea_parser, set_pod_parser
from jina.peapods.pods import BasePod
from jina.peapods.runtimes.remote.ssh import SSHRuntime
from jina.proto import jina_pb2
@pytest.mark.skip('works locally, but until I findout h... | [
"jina.peapods.runtimes.remote.ssh.SSHRuntime",
"pytest.mark.skip",
"jina.parser.set_pea_parser",
"jina.flow.Flow",
"jina.peapods.pods.BasePod",
"jina.parser.set_pod_parser"
] | [((266, 370), 'pytest.mark.skip', 'pytest.mark.skip', (['"""works locally, but until I findout how to mock ssh, this has to be skipped"""'], {}), "(\n 'works locally, but until I findout how to mock ssh, this has to be skipped'\n )\n", (282, 370), False, 'import pytest\n'), ((621, 726), 'pytest.mark.skip', 'pytes... |
import os
import sys
from copy import deepcopy
import traceback
import functools
from collections import defaultdict
import yaml
from argparse import ArgumentParser,\
RawDescriptionHelpFormatter, ArgumentDefaultsHelpFormatter
from sgains.configuration.parser import SgainsValidator, Config
from sgains.configurat... | [
"sgains.pipelines.composite_pipeline.CompositePipeline",
"sgains.pipelines.mappableregions_pipeline.MappableRegionsPipeline",
"sgains.pipelines.varbin_10x_pipeline.Varbin10xPipeline",
"sgains.pipelines.bins_pipeline.BinsPipeline",
"copy.deepcopy",
"sgains.pipelines.r_pipeline.Rpipeline",
"sgains.pipelin... | [((4403, 4414), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (4412, 4414), False, 'import os\n'), ((6285, 6302), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (6296, 6302), False, 'from collections import defaultdict\n'), ((6322, 6333), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (6331, 6333), Fa... |
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import setup, find_packages, Command
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'xmind2testcase', '__about__.py'), encoding='utf-8') as f: # custom
... | [
"setuptools.find_packages",
"os.path.join",
"io.open",
"os.path.dirname",
"sys.exit",
"os.system"
] | [((191, 216), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (206, 216), False, 'import os\n'), ((351, 389), 'io.open', 'io.open', (['"""README.md"""'], {'encoding': '"""utf-8"""'}), "('README.md', encoding='utf-8')\n", (358, 389), False, 'import io\n'), ((231, 283), 'os.path.join', 'os.path.... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
"oci.util.formatted_flat_dict"
] | [((3416, 3441), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', (['self'], {}), '(self)\n', (3435, 3441), False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')] |
"""
Random Variables.
This module implements random variables. Random variables are the main in- and outputs
of probabilistic numerical methods.
"""
from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
import numpy as np
from probnum import utils as _utils
from probnum.type import (
... | [
"numpy.prod",
"probnum.utils.as_shape",
"numpy.sqrt",
"numpy.isscalar",
"numpy.promote_types",
"probnum.utils.as_random_state",
"numpy.asarray",
"probnum.utils.as_numpy_scalar",
"numpy.diag",
"numpy.issubdtype",
"numpy.empty",
"probnum.utils.derive_random_seed",
"numpy.dtype",
"typing.Type... | [((658, 678), 'typing.TypeVar', 'TypeVar', (['"""ValueType"""'], {}), "('ValueType')\n", (665, 678), False, 'from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union\n'), ((4355, 4377), 'probnum.utils.as_shape', '_utils.as_shape', (['shape'], {}), '(shape)\n', (4370, 4377), True, 'from probnum i... |
# Copyright 2012 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... | [
"json.loads",
"gcutil_lib.gcutil_unittest.SelectTemplateForVersion",
"gcutil_lib.mock_lists.GetSampleRegionListCall",
"gcutil_lib.mock_api.CreateApi",
"gcutil_lib.gcutil_unittest.GcutilLoader",
"path_initializer.InitSysPath"
] | [((674, 704), 'path_initializer.InitSysPath', 'path_initializer.InitSysPath', ([], {}), '()\n', (702, 704), False, 'import path_initializer\n'), ((1023, 1055), 'gcutil_lib.mock_api.CreateApi', 'mock_api.CreateApi', (['self.version'], {}), '(self.version)\n', (1041, 1055), False, 'from gcutil_lib import mock_api\n'), ((... |
#!/usr/bin/env python
# Copyright 2018 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Utility tools that extracts DWARF informatio... | [
"logging.getLogger",
"os.path.exists",
"collections.namedtuple",
"argparse.ArgumentParser",
"subprocess.Popen",
"os.environ.get",
"math.log",
"tools.shared.asstr",
"re.finditer",
"sys.exit",
"os.path.abspath",
"json.dump",
"re.search"
] | [((838, 873), 'logging.getLogger', 'logging.getLogger', (['"""wasm-sourcemap"""'], {}), "('wasm-sourcemap')\n", (855, 873), False, 'import logging\n'), ((2912, 2960), 'collections.namedtuple', 'namedtuple', (['"""SourceMapPrefixes"""', '"""sources, load"""'], {}), "('SourceMapPrefixes', 'sources, load')\n", (2922, 2960... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | [
"subprocess.check_output",
"signal.signal",
"apache_beam.utils.subprocess_server.JavaJarServer.path_to_beam_jar",
"apache_beam.runners.portability.local_job_service.LocalJobServicer",
"apache_beam.utils.subprocess_server.pick_port",
"threading.Lock",
"apache_beam.utils.subprocess_server.SubprocessServer... | [((3638, 3680), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.apache_beam/cache"""'], {}), "('~/.apache_beam/cache')\n", (3656, 3680), False, 'import os\n'), ((1631, 1668), 'grpc.insecure_channel', 'grpc.insecure_channel', (['self._endpoint'], {}), '(self._endpoint)\n', (1652, 1668), False, 'import grpc\n'), ((1... |
from collections import defaultdict
from functools import wraps
from itertools import chain
from sympy.core import sympify
from .precedence import precedence
from .codeprinter import CodePrinter
_kw_py2and3 = {
'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finall... | [
"collections.defaultdict"
] | [((2720, 2736), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (2731, 2736), False, 'from collections import defaultdict\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 12:10:11 2019
@author: Omer
"""
## File handler
## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf
## The values from the above pdf were copied manually to a txt file, and ... | [
"numpy.eye",
"sys.path.insert",
"numpy.hstack",
"pathlib.Path",
"os.environ.get",
"os.path.join",
"numpy.array",
"numpy.zeros",
"scipy.linalg.circulant",
"numpy.vstack",
"os.walk"
] | [((694, 716), 'os.environ.get', 'os.environ.get', (['"""LDPC"""'], {}), "('LDPC')\n", (708, 716), False, 'import os\n'), ((907, 937), 'sys.path.insert', 'sys.path.insert', (['(1)', 'projectDir'], {}), '(1, projectDir)\n', (922, 937), False, 'import sys\n'), ((1038, 1097), 'numpy.array', 'np.array', (['[8, 4, 2, 1]'], {... |
import unittest
from ..adl import ADL
import six
if six.PY3:
from unittest.mock import Mock, MagicMock
else:
from mock import Mock, MagicMock
class ADLTest(unittest.TestCase):
"""
Tests for `ADL`
"""
def setUp(self):
self.ls = Mock(return_value=["foo", "bar", "baz"])
self.fak... | [
"mock.Mock",
"mock.MagicMock"
] | [((263, 303), 'mock.Mock', 'Mock', ([], {'return_value': "['foo', 'bar', 'baz']"}), "(return_value=['foo', 'bar', 'baz'])\n", (267, 303), False, 'from mock import Mock, MagicMock\n'), ((328, 339), 'mock.MagicMock', 'MagicMock', ([], {}), '()\n', (337, 339), False, 'from mock import Mock, MagicMock\n'), ((486, 518), 'mo... |
#!/usr/bin/python3.4
__author__ = "<NAME>"
import sys
import os
sys.path.append("..")
import unittest
from modules import storage
from modules.service import Service
from modules.database import Database
class TestStorage(unittest.TestCase):
def setUp(self):
self.service = Service()
self.databas... | [
"modules.service.Service",
"modules.storage.read",
"modules.storage.write",
"os.getcwd",
"unittest.main",
"modules.database.Database",
"sys.path.append"
] | [((65, 86), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (80, 86), False, 'import sys\n'), ((1806, 1821), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1819, 1821), False, 'import unittest\n'), ((290, 299), 'modules.service.Service', 'Service', ([], {}), '()\n', (297, 299), False, 'from ... |
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name="fant_sizer",
version="0.7",
author="<NAME>",
author_email="<EMAIL>",
description="fant_sizer command-line file-information",
url="https://github.com/ripiuk/fant_sizer",
key... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((840, 855), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (853, 855), False, 'from setuptools import setup, find_packages\n'), ((892, 909), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (899, 909), False, 'from os.path import join, dirname\n')] |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
def fixed_padding(inputs, kernel_size, dilation):
kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)
... | [
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.utils.model_zoo.load_url",
"math.sqrt",
"torch.nn.Conv2d",
"torch.nn.functional.pad",
"torch.rand"
] | [((441, 492), 'torch.nn.functional.pad', 'F.pad', (['inputs', '(pad_beg, pad_end, pad_beg, pad_end)'], {}), '(inputs, (pad_beg, pad_end, pad_beg, pad_end))\n', (446, 492), True, 'import torch.nn.functional as F\n'), ((11424, 11450), 'torch.rand', 'torch.rand', (['(1)', '(3)', '(512)', '(512)'], {}), '(1, 3, 512, 512)\n... |
"""
"""
# Created on 2015.08.19
#
# Author: <NAME>
#
# Copyright 2015 - 2018 <NAME>
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version... | [
"pyasn1.codec.ber.encoder.Encoder",
"pyasn1.compat.octets.ints2octs",
"copy.deepcopy"
] | [((3063, 3079), 'copy.deepcopy', 'deepcopy', (['tagMap'], {}), '(tagMap)\n', (3071, 3079), False, 'from copy import deepcopy\n'), ((3101, 3118), 'copy.deepcopy', 'deepcopy', (['typeMap'], {}), '(typeMap)\n', (3109, 3118), False, 'from copy import deepcopy\n'), ((3250, 3286), 'pyasn1.codec.ber.encoder.Encoder', 'Encoder... |
import copy
from contextlib import contextmanager
from functools import wraps
from collections import defaultdict
import tensorflow as tf
_ArgScopeStack = []
@contextmanager
def arg_scope(layers, **kwargs):
"""
Args:
layers (list or layer): layer or list of layers to apply the arguments.
Returns... | [
"collections.defaultdict",
"functools.wraps"
] | [((2018, 2038), 'functools.wraps', 'wraps', (['original_init'], {}), '(original_init)\n', (2023, 2038), False, 'from functools import wraps\n'), ((1427, 1444), 'collections.defaultdict', 'defaultdict', (['dict'], {}), '(dict)\n', (1438, 1444), False, 'from collections import defaultdict\n')] |
import pygame
class Player(pygame.sprite.Sprite):
death = [pygame.image.load('Images/death1.png'), pygame.image.load('Images/death2.png'),
pygame.image.load('Images/death3.png'),
pygame.image.load('Images/death4.png'), pygame.image.load('Images/death5.png'),
pygame.im... | [
"pygame.image.load",
"pygame.Rect",
"pygame.sprite.spritecollide",
"pygame.Surface"
] | [((69, 107), 'pygame.image.load', 'pygame.image.load', (['"""Images/death1.png"""'], {}), "('Images/death1.png')\n", (86, 107), False, 'import pygame\n'), ((109, 147), 'pygame.image.load', 'pygame.image.load', (['"""Images/death2.png"""'], {}), "('Images/death2.png')\n", (126, 147), False, 'import pygame\n'), ((163, 20... |
"""A file containing representations of install configurations.
The core Data representation for installSynApps. An InstallConfiguration object
is parsed from a configuration, and is then used throughout the build process.
InjectorFile objects are used for representing text that need to be injected
into configuration... | [
"os.path.exists",
"os.access",
"os.path.dirname",
"installSynApps.data_model.install_module.InstallModule",
"installSynApps.join_path",
"os.path.abspath",
"installSynApps.sync_all_module_tags"
] | [((1937, 1970), 'os.path.abspath', 'os.path.abspath', (['install_location'], {}), '(install_location)\n', (1952, 1970), False, 'import os\n'), ((12720, 12806), 'installSynApps.data_model.install_module.InstallModule', 'IM', (['"""EPICS_BASE"""', '"""R7.0.3"""', '"""$(INSTALL)/base"""', 'gu', 'base_org', '"""epics-base"... |
#!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 la... | [
"twisted.names.dns.Record_A",
"twisted.internet.reactor.listenUDP",
"yaml.load",
"time.sleep",
"twisted.names.server.DNSServerFactory",
"twisted.names.common.ResolverBase.__init__",
"sys.exit",
"argparse.ArgumentParser",
"twisted.names.dns.Record_TXT",
"os.getpid",
"twisted.internet.reactor.run"... | [((4162, 4200), 'twisted.names.dns.Record_SOA', 'dns.Record_SOA', ([], {'mname': 'common_zone_name'}), '(mname=common_zone_name)\n', (4176, 4200), False, 'from twisted.names import client, server, common, authority, dns\n'), ((4332, 4411), 'twisted.names.server.DNSServerFactory', 'twisted.names.server.DNSServerFactory'... |
# -*- coding: utf-8 -*-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
import numpy as np
import colour
from colour.utilities import message_box
message_box('"ICTCP" Colour Encoding Computations')
RGB = np.array([0.45620519, 0.03081071, 0.04091952])
message_box(('Converting from "ITU-R BT.2020" colourspa... | [
"colour.ICTCP_to_RGB",
"colour.utilities.message_box",
"numpy.array",
"colour.RGB_to_ICTCP"
] | [((159, 210), 'colour.utilities.message_box', 'message_box', (['""""ICTCP" Colour Encoding Computations"""'], {}), '(\'"ICTCP" Colour Encoding Computations\')\n', (170, 210), False, 'from colour.utilities import message_box\n'), ((218, 264), 'numpy.array', 'np.array', (['[0.45620519, 0.03081071, 0.04091952]'], {}), '([... |
"""
This is a demonstration script for using the Transect class in the COAsT
package. This object has strict data formatting requirements, which are
outlined in tranect.py.
Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them.
---
In ... | [
"coast.Gridded",
"coast.TransectF",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.figure",
"coast.TransectT",
"matplotlib.pyplot.show"
] | [((1351, 1440), 'coast.Gridded', 'coast.Gridded', ([], {'fn_data': 'fn_nemo_dat_t', 'fn_domain': 'fn_nemo_dom', 'config': 'fn_config_t_grid'}), '(fn_data=fn_nemo_dat_t, fn_domain=fn_nemo_dom, config=\n fn_config_t_grid)\n', (1364, 1440), False, 'import coast\n'), ((1724, 1769), 'coast.TransectT', 'coast.TransectT', ... |
import pytest
import numpy as np
from pathlib import Path
def extract_param(data, n_states):
keys = ("initial_state_prob", "transition_prob", "means", "st_devs")
param = {"n_states": n_states}
for key in keys:
param[key] = data[f"{key}_{n_states}"]
return param
@pytest.fixture(scope="session... | [
"pytest.fixture",
"pathlib.Path"
] | [((291, 340), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'params': '[2, 3, 4]'}), "(scope='session', params=[2, 3, 4])\n", (305, 340), False, 'import pytest\n'), ((679, 710), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (693, 710), False, 'import ... |
import filters as f
from iota import TransactionHash, Address
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
__all__ = [
'GetNodeInfoCommand',
]
class GetNodeInfoCommand(FilterCommand):
"""
Executes `getNodeInfo` command.
See :py:meth:`iota.ap... | [
"iota.filters.Trytes",
"filters.ByteString"
] | [((1003, 1033), 'filters.ByteString', 'f.ByteString', ([], {'encoding': '"""ascii"""'}), "(encoding='ascii')\n", (1015, 1033), True, 'import filters as f\n'), ((1036, 1051), 'iota.filters.Trytes', 'Trytes', (['Address'], {}), '(Address)\n', (1042, 1051), False, 'from iota.filters import Trytes\n'), ((1100, 1130), 'filt... |
from Negocio import controller
import forms, functions
from flask import Flask, render_template, request, redirect, url_for, flash
def register(mysql, request):
registerForm= forms.RegisterForm(request.form)
if request.method == 'POST' and registerForm.validate():
return controller.registraUsuario(mysql... | [
"flask.render_template",
"flask.request.args.get",
"Negocio.controller.datosEjercicios",
"Negocio.controller.mostrar_historial_rutina",
"Negocio.controller.registraUsuario",
"functions.porcentajeGrasa",
"Negocio.controller.formulario_perfil",
"Negocio.controller.actualizar_perfil",
"Negocio.controll... | [((182, 214), 'forms.RegisterForm', 'forms.RegisterForm', (['request.form'], {}), '(request.form)\n', (200, 214), False, 'import forms, functions\n'), ((355, 406), 'flask.render_template', 'render_template', (['"""register.html"""'], {'form': 'registerForm'}), "('register.html', form=registerForm)\n", (370, 406), False... |
# -*- coding: UTF-8 -*-
"""
This module provides Runner class to run behave feature files (or model elements).
"""
from __future__ import absolute_import, print_function, with_statement
import contextlib
import os.path
import sys
import warnings
import weakref
import six
from behave._types import ExceptionUtil
from... | [
"behave.runner_util.parse_features",
"behave._types.ExceptionUtil.set_traceback",
"traceback.extract_stack",
"traceback.format_tb",
"behave.exception.ConfigError",
"behave.runner_util.PathManager",
"sys.exc_info",
"behave.runner_util.exec_file",
"weakref.proxy",
"behave._types.ExceptionUtil.descri... | [((5457, 5478), 'weakref.proxy', 'weakref.proxy', (['runner'], {}), '(runner)\n', (5470, 5478), False, 'import weakref\n'), ((6802, 6838), 'traceback.print_exc', 'traceback.print_exc', ([], {'file': 'sys.stdout'}), '(file=sys.stdout)\n', (6821, 6838), False, 'import traceback\n'), ((9702, 9798), 'warnings.warn', 'warni... |
add_library('pdf')
import random
from datetime import datetime
tileCount = 20
def setup():
global savePDF, actStrokeCap, actRandomSeed, colorLeft, colorRight, alphaLeft, alphaRight
savePDF = False
actStrokeCap = ROUND
actRandomSeed = 0
colorLeft = color(197, 0, 123)
colorRight = color(87, 35,... | [
"datetime.datetime.now",
"random.randint",
"random.seed"
] | [((648, 674), 'random.seed', 'random.seed', (['actRandomSeed'], {}), '(actRandomSeed)\n', (659, 674), False, 'import random\n'), ((1487, 1512), 'random.randint', 'random.randint', (['(0)', '(100000)'], {}), '(0, 100000)\n', (1501, 1512), False, 'import random\n'), ((865, 885), 'random.randint', 'random.randint', (['(0)... |
import enum
from dataclasses import dataclass, field
from itertools import chain, islice
from mashumaro import DataClassMessagePackMixin
from multiprocessing.synchronize import Lock
from typing import (
Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple,
TypeVar, Callable, Iterable, Generic, ... | [
"itertools.islice",
"dbt.adapters.factory.get_adapter_package_names",
"dbt.ui.line_wrap_message",
"dbt.exceptions.raise_duplicate_source_patch_name",
"dbt.contracts.util.schema_version",
"dbt.exceptions.raise_compiler_error",
"dbt.exceptions.raise_duplicate_resource_name",
"dbt.exceptions.raise_duplic... | [((11468, 11502), 'typing.TypeVar', 'TypeVar', (['"""M"""'], {'bound': 'MacroCandidate'}), "('M', bound=MacroCandidate)\n", (11475, 11502), False, 'from typing import Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple, TypeVar, Callable, Iterable, Generic, cast, AbstractSet, ClassVar\n'), ((12186, 12... |
import argparse
from collections import defaultdict
import csv
from dataclasses import dataclass, field
from enum import Enum, unique, auto
import os
import sys
import tempfile
import yaml
import zipfile
import gffutils
from google.protobuf import json_format
from ncbi.datasets.v1alpha1 import dataset_catalog_pb2
from... | [
"argparse.ArgumentParser",
"zipfile.ZipFile",
"ncbi.datasets.v1alpha1.dataset_catalog_pb2.Catalog",
"os.path.join",
"csv.writer",
"gffutils.create_db",
"os.path.isfile",
"collections.defaultdict",
"tempfile.NamedTemporaryFile",
"ncbi.datasets.reports.report_reader.DatasetsReportReader"
] | [((1509, 1526), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1520, 1526), False, 'from collections import defaultdict\n'), ((1916, 1948), 'os.path.join', 'os.path.join', (['path', 'f"""{acc}.zip"""'], {}), "(path, f'{acc}.zip')\n", (1928, 1948), False, 'import os\n'), ((1956, 1977), 'os.path.i... |
# -*- coding: utf-8 -*-
from scrapy import Request
from scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider
class GlidedSky001Spider(DdiyBaseSpider):
name = 'glided_sky_001'
description = 'GlidedSky 爬虫-基础1'
start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1'
custom_settings = {
... | [
"scrapy.Request"
] | [((549, 597), 'scrapy.Request', 'Request', ([], {'url': 'self.start_url', 'callback': 'self.parse'}), '(url=self.start_url, callback=self.parse)\n', (556, 597), False, 'from scrapy import Request\n')] |
#
# Copyright 2017 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 writin... | [
"tensorflow.contrib.slim.python.slim.data.dataset.Dataset",
"tensorflow.contrib.slim.python.slim.data.tfexample_decoder.TFExampleDecoder",
"tensorflow.logging.info",
"datasets.celeba.image_decoder.ImageDecodeProcess",
"os.path.join",
"tensorflow.contrib.slim.python.slim.data.tfexample_decoder.Tensor",
"... | [((3716, 3769), 'os.path.join', 'os.path.join', (['dataset_dir', '"""attribute_label_map.json"""'], {}), "(dataset_dir, 'attribute_label_map.json')\n", (3728, 3769), False, 'import os\n'), ((3830, 3883), 'os.path.join', 'os.path.join', (['dataset_dir', '(_FILE_PATTERN % split_name)'], {}), '(dataset_dir, _FILE_PATTERN ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: ASRDriverParts/UNIInterface.py
'''
Parts Module for ASR driver UNI interface configuraton
'''
import GlobalModule
from EmCommonLog import decorater_log
from ASRDriverParts.InterfaceBase im... | [
"GlobalModule.EM_LOGGER.debug"
] | [((1985, 2063), 'GlobalModule.EM_LOGGER.debug', 'GlobalModule.EM_LOGGER.debug', (["('uni if command = %s' % (self._tmp_add_command,))"], {}), "('uni if command = %s' % (self._tmp_add_command,))\n", (2013, 2063), False, 'import GlobalModule\n')] |
"""
Copyright (c) 2019 Intel 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 writing,... | [
"numpy.zeros"
] | [((5319, 5337), 'numpy.zeros', 'np.zeros', (['(28, 28)'], {}), '((28, 28))\n', (5327, 5337), True, 'import numpy as np\n')] |
from PyQt5 import QtWidgets, uic
from Factory import Factory
from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox
from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget
import Constant as c
class RegularPolygonDialog(QtWidgets.QDialog):
def __init__(self, scene... | [
"Factory.Factory.next_id",
"Fill.ListWidget.fill_listWidget_with_data",
"PyQt5.uic.loadUi",
"Fill.ListWidget.set_selected_id_in_listWidget",
"Dialogs.DialogMacros.turn_into_free_point",
"Factory.Factory.create_empty_item",
"Dialogs.DialogMacros.free_point_checkbox"
] | [((446, 483), 'PyQt5.uic.loadUi', 'uic.loadUi', (['"""regularpolygon.ui"""', 'self'], {}), "('regularpolygon.ui', self)\n", (456, 483), False, 'from PyQt5 import QtWidgets, uic\n'), ((1820, 1862), 'Factory.Factory.create_empty_item', 'Factory.create_empty_item', (['"""polygon"""', 'None'], {}), "('polygon', None)\n", (... |
import unittest
from networks.QoS import QoS
from networks.connections.mathematical_connections import FunctionalDegradation
from networks.slicing import SliceConceptualGraph
from utils.location import Location
class TestBaseStationLinear(unittest.TestCase):
def setUp(self):
self.name = "network"
... | [
"networks.QoS.QoS",
"networks.slicing.SliceConceptualGraph",
"utils.location.Location"
] | [((1054, 1144), 'networks.slicing.SliceConceptualGraph', 'SliceConceptualGraph', (['self.name', 'self.midhaul_qos', 'self.backhaul_qos', 'self.parameters'], {}), '(self.name, self.midhaul_qos, self.backhaul_qos, self.\n parameters)\n', (1074, 1144), False, 'from networks.slicing import SliceConceptualGraph\n'), ((54... |
"""
Setup DB with example data for tests
"""
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User, Group
from django.core.management.base import BaseCommand
from api import models
class Command(BaseCommand):
help = 'Setup DB with example data for tests'
... | [
"django.contrib.auth.models.Group.objects.get",
"django.contrib.auth.hashers.make_password",
"api.models.JobTemplate.objects.create",
"api.models.Task.objects.create",
"api.models.Inventory.objects.create",
"django.contrib.auth.models.User.objects.get"
] | [((526, 565), 'django.contrib.auth.models.User.objects.get', 'User.objects.get', ([], {'username': '"""thomastest"""'}), "(username='thomastest')\n", (542, 565), False, 'from django.contrib.auth.models import User, Group\n'), ((681, 717), 'django.contrib.auth.models.User.objects.get', 'User.objects.get', ([], {'usernam... |
from __future__ import absolute_import, unicode_literals
import os
import distro
def get_distro_info(root_dir):
# We point _UNIXCONFDIR to root_dir
old_value = distro._UNIXCONFDIR
distro._UNIXCONFDIR = os.path.join(root_dir, 'etc')
obj = distro.LinuxDistribution(include_lsb=False, include_uname=Fal... | [
"os.path.join",
"distro.LinuxDistribution"
] | [((218, 247), 'os.path.join', 'os.path.join', (['root_dir', '"""etc"""'], {}), "(root_dir, 'etc')\n", (230, 247), False, 'import os\n'), ((259, 323), 'distro.LinuxDistribution', 'distro.LinuxDistribution', ([], {'include_lsb': '(False)', 'include_uname': '(False)'}), '(include_lsb=False, include_uname=False)\n', (283, ... |
import numpy as np
import sys
import os
from PIL import Image
from visu.helper_functions import save_image
from scipy.spatial.transform import Rotation as R
from helper import re_quat
import copy
import torch
import numpy as np
import k3d
class Visualizer():
def __init__(self, p_visu, writer=None):
if p_v... | [
"k3d.plot",
"PIL.Image.fromarray",
"os.path.exists",
"PIL.Image.open",
"numpy.ones",
"numpy.add",
"os.makedirs",
"scipy.spatial.transform.Rotation.from_quat",
"numpy.array",
"numpy.dot",
"copy.deepcopy",
"os.system"
] | [((4150, 4173), 'k3d.plot', 'k3d.plot', ([], {'name': '"""points"""'}), "(name='points')\n", (4158, 4173), False, 'import k3d\n'), ((4842, 4865), 'k3d.plot', 'k3d.plot', ([], {'name': '"""points"""'}), "(name='points')\n", (4850, 4865), False, 'import k3d\n'), ((1091, 1109), 'copy.deepcopy', 'copy.deepcopy', (['img'], ... |
# Copyright (c) 2013 Rackspace, 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 w... | [
"json.dumps"
] | [((8466, 8517), 'json.dumps', 'json.dumps', (['JSON_HOME'], {'ensure_ascii': '(False)', 'indent': '(4)'}), '(JSON_HOME, ensure_ascii=False, indent=4)\n', (8476, 8517), False, 'import json\n')] |
import asyncio
import logging
import synapse.exc as s_exc
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.version as s_version
logger = logging.getLogger(__name__)
class Cpe23Str(s_types.Str):
'''
CPE 2.3 Formatted String
https://nvlpubs.nist.gov/nistpubs/Leg... | [
"logging.getLogger",
"synapse.lib.version.parseSemver",
"synapse.lib.version.unpackVersion",
"synapse.exc.BadTypeValu",
"synapse.lib.version.packVersion",
"synapse.lib.types.Str.__init__",
"synapse.lib.types.Str._normPyStr",
"synapse.lib.version.parseVersionParts",
"synapse.lib.types.Int.postTypeIni... | [((183, 210), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (200, 210), False, 'import logging\n'), ((612, 662), 'synapse.lib.types.Str.__init__', 's_types.Str.__init__', (['self', 'modl', 'name', 'info', 'opts'], {}), '(self, modl, name, info, opts)\n', (632, 662), True, 'import synapse... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unit tests."""
import os
import unittest
from copy import copy
from webui.app import create_app
class TestRoutes(unittest.TestCase):
"""Test routes."""
ignore_routes = ('/static/<path:filename>',)
ignore_end_patterns = ('>',)
def setUp(self):
... | [
"os.path.realpath",
"copy.copy",
"test.utils.doctest_unittest_runner.doctest_unittest_runner",
"webui.app.create_app"
] | [((1314, 1422), 'test.utils.doctest_unittest_runner.doctest_unittest_runner', 'doctest_unittest_runner', ([], {'test_dir': 'TEST_DIR', 'relative_path_to_root': '"""../"""', 'package_names': "['webui', 'test']"}), "(test_dir=TEST_DIR, relative_path_to_root='../',\n package_names=['webui', 'test'])\n", (1337, 1422), F... |
#!/usr/bin/env python
# Copyright 1996-2021 Cyberbotics Ltd.
#
# 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 applica... | [
"subprocess.check_output",
"os.path.exists",
"distutils.spawn.find_executable",
"os.path.join",
"os.path.splitext",
"io.open",
"os.getcwd",
"os.path.isfile",
"os.chdir",
"unittest.main",
"os.walk"
] | [((6922, 6937), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6935, 6937), False, 'import unittest\n'), ((1123, 1182), 'subprocess.check_output', 'subprocess.check_output', (["['clang-format', '-style=file', f]"], {}), "(['clang-format', '-style=file', f])\n", (1146, 1182), False, 'import subprocess\n'), ((3239,... |
# Copyright 2019 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 or agreed to in writing, ... | [
"system.shell.get_directory_size",
"os.path.exists",
"system.shell.remove_empty_files",
"mock.patch",
"system.shell.which",
"tests.test_libs.helpers.patch",
"system.shell.clear_system_temp_directory",
"system.shell.get_execute_command",
"os.symlink",
"system.shell.get_interpreter",
"system.envir... | [((1877, 1915), 'mock.patch', 'mock.patch', (['"""os.remove"""'], {'autospec': '(True)'}), "('os.remove', autospec=True)\n", (1887, 1915), False, 'import mock\n'), ((1106, 1138), 'tests.test_libs.test_utils.set_up_pyfakefs', 'test_utils.set_up_pyfakefs', (['self'], {}), '(self)\n', (1132, 1138), False, 'from tests.test... |
import os
from PIL import Image
import cv2
from os import listdir
from os.path import join
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import LogNorm
from io_utils.io_common import create_folder
from viz_utils.constants import PlotMode, BackgroundType
import pylab
import numpy as np
import... | [
"io_utils.io_common.create_folder",
"cv2.destroyAllWindows",
"numpy.rot90",
"numpy.flip",
"os.listdir",
"numpy.asarray",
"matplotlib.pyplot.close",
"cv2.VideoWriter_fourcc",
"numpy.amin",
"cartopy.crs.PlateCarree",
"numpy.isnan",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"PIL.Im... | [((3165, 3183), 'cartopy.crs.PlateCarree', 'ccrs.PlateCarree', ([], {}), '()\n', (3181, 3183), True, 'import cartopy.crs as ccrs\n'), ((12073, 12171), 'cartopy.feature.NaturalEarthFeature', 'cfeature.NaturalEarthFeature', ([], {'category': '"""cultural"""', 'name': '"""roads"""', 'scale': '"""10m"""', 'facecolor': '"""... |
from os import listdir
from os.path import isfile, join
from path import Path
import numpy as np
import cv2
# Dataset path
target_path = Path('target/')
annotation_images_path = Path('dataset/ade20k/annotations/training/').abspath()
dataset = [ f for f in listdir(annotation_images_path) if isfile(join(annotation_image... | [
"os.listdir",
"numpy.where",
"numpy.asarray",
"os.path.join",
"path.Path"
] | [((138, 153), 'path.Path', 'Path', (['"""target/"""'], {}), "('target/')\n", (142, 153), False, 'from path import Path\n'), ((577, 613), 'numpy.asarray', 'np.asarray', (['images[n]'], {'dtype': 'np.int8'}), '(images[n], dtype=np.int8)\n', (587, 613), True, 'import numpy as np\n'), ((734, 769), 'numpy.where', 'np.where'... |
# -*- coding: utf-8 -*
'''
最大堆实现
98
/ \
96 84
/ \ / \
92 82 78 47
/ \ / \ / \ / \
... | [
"random.randint"
] | [((1986, 2006), 'random.randint', 'random.randint', (['(1)', 'M'], {}), '(1, M)\n', (2000, 2006), False, 'import random\n')] |
import mxnet as mx
def slice_symbol_to_seq_symobls(net, seq_len, axis=1, squeeze_axis=True):
net = mx.sym.SliceChannel(data=net, num_outputs=seq_len, axis=axis, squeeze_axis=squeeze_axis)
hidden_all = []
for seq_index in range(seq_len):
hidden_all.append(net[seq_index])
net = hidden_all
re... | [
"mxnet.sym.SliceChannel"
] | [((105, 198), 'mxnet.sym.SliceChannel', 'mx.sym.SliceChannel', ([], {'data': 'net', 'num_outputs': 'seq_len', 'axis': 'axis', 'squeeze_axis': 'squeeze_axis'}), '(data=net, num_outputs=seq_len, axis=axis, squeeze_axis=\n squeeze_axis)\n', (124, 198), True, 'import mxnet as mx\n')] |
import datetime
import json
from calendar import timegm
from urllib.parse import parse_qsl
import requests
from allauth.socialaccount import models as aamodels
from requests_oauthlib import OAuth1
from rest_framework import parsers, renderers
from rest_framework import status
from rest_framework.authtoken.models impor... | [
"json.loads",
"requests.post",
"datetime.datetime.utcnow",
"spa.models.socialaccountlink.SocialAccountLink.objects.get",
"rest_framework_jwt.utils.jwt_payload_handler",
"json.dumps",
"rest_framework_jwt.utils.jwt_encode_handler",
"requests.get",
"spa.models.UserProfile.objects.get",
"rest_framewor... | [((1090, 1134), 'spa.models.socialaccountlink.SocialAccountLink.objects.get', 'SocialAccountLink.objects.get', ([], {'social_id': 'uid'}), '(social_id=uid)\n', (1119, 1134), False, 'from spa.models.socialaccountlink import SocialAccountLink\n'), ((1349, 1387), 'spa.models.UserProfile.objects.get', 'UserProfile.objects.... |
import requests
import aiohttp
from constants import API_KEY
class User(object):
def __init__(self, author_info):
# "author": {
# "about": "",
# "avatar": {
# "cache": "//a.disquscdn.com/1519942534/images/noavatar92.png",
# ... | [
"aiohttp.TCPConnector",
"requests.get"
] | [((4315, 4420), 'requests.get', 'requests.get', (['"""https://disqus.com/api/3.0/users/details.json"""', "{'user': self.id, 'api_key': API_KEY}"], {}), "('https://disqus.com/api/3.0/users/details.json', {'user': self\n .id, 'api_key': API_KEY})\n", (4327, 4420), False, 'import requests\n'), ((1751, 1789), 'aiohttp.T... |
from flask_restful import Resource, reqparse
from firebase_admin import auth as firebase_auth
from dbcls.models import User
parser = reqparse.RequestParser()
parser.add_argument('token', type=str, required=True, nullable=False)
class Authenticate(Resource):
def post(self):
try:
args = parse... | [
"firebase_admin.auth.verify_id_token",
"firebase_admin.auth.create_custom_token",
"flask_restful.reqparse.RequestParser",
"dbcls.models.User.query.filter_by"
] | [((136, 160), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (158, 160), False, 'from flask_restful import Resource, reqparse\n'), ((748, 795), 'firebase_admin.auth.create_custom_token', 'firebase_auth.create_custom_token', (['firebase_uid'], {}), '(firebase_uid)\n', (781, 795), Tru... |
import csv
import logging
import os
import shutil
from csv import DictWriter # noqa: F401
from pyhocon import ConfigTree, ConfigFactory # noqa: F401
from typing import Dict, Any # noqa: F401
from databuilder.job.base_job import Job
from databuilder.loader.base_loader import Loader
from databuilder.models.neo4j_csv... | [
"logging.getLogger",
"os.path.exists",
"databuilder.utils.closer.Closer",
"os.makedirs",
"databuilder.job.base_job.Job.closer.register",
"shutil.rmtree",
"pyhocon.ConfigFactory.from_dict"
] | [((544, 571), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (561, 571), False, 'import logging\n'), ((1026, 1113), 'pyhocon.ConfigFactory.from_dict', 'ConfigFactory.from_dict', (['{SHOULD_DELETE_CREATED_DIR: True, FORCE_CREATE_DIR: False}'], {}), '({SHOULD_DELETE_CREATED_DIR: True, FORCE... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import pandas as pd
from sklearn.neighbors import NearestNeighbors # k-NN
k_in_knn = 5 # k-NN における k
rate_of_training_samples_inside_ad = 0.96 # AD 内となるトレーニングデータの割合。AD のしきい値を決めるときに使用
dataset = pd.read_csv('resin.csv', index_col=0, header=0)
x_prediction ... | [
"pandas.DataFrame",
"sklearn.neighbors.NearestNeighbors",
"pandas.read_csv"
] | [((258, 305), 'pandas.read_csv', 'pd.read_csv', (['"""resin.csv"""'], {'index_col': '(0)', 'header': '(0)'}), "('resin.csv', index_col=0, header=0)\n", (269, 305), True, 'import pandas as pd\n'), ((322, 380), 'pandas.read_csv', 'pd.read_csv', (['"""resin_prediction.csv"""'], {'index_col': '(0)', 'header': '(0)'}), "('r... |
"""
Migration script to add 'ldda_id' column to the implicitly_converted_dataset_association table.
"""
from __future__ import print_function
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData
)
from galaxy.model.migrate.versions.util import (
add_column,
drop_colum... | [
"logging.getLogger",
"galaxy.model.migrate.versions.util.drop_column",
"galaxy.model.migrate.versions.util.add_column",
"sqlalchemy.ForeignKey",
"sqlalchemy.MetaData",
"sqlalchemy.Column"
] | [((331, 358), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (348, 358), False, 'import logging\n'), ((370, 380), 'sqlalchemy.MetaData', 'MetaData', ([], {}), '()\n', (378, 380), False, 'from sqlalchemy import Column, ForeignKey, Integer, MetaData\n'), ((831, 957), 'galaxy.model.migrate.v... |
# The Topical Guide
# Copyright 2010-2011 Brigham Young University
#
# This file is part of the Topical Guide <http://nlp.cs.byu.edu/topic_browser>.
#
# The Topical Guide is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by the
# Free Soft... | [
"django.shortcuts.redirect"
] | [((1820, 1833), 'django.shortcuts.redirect', 'redirect', (['"""/"""'], {}), "('/')\n", (1828, 1833), False, 'from django.shortcuts import render, redirect\n')] |
"""Tests for merge.py."""
from __future__ import absolute_import, division, print_function
from glob import glob
import os
import tarfile
import tempfile
from neurodocker.docker import client
from neurodocker.reprozip.trace import ReproZipMinimizer
from neurodocker.reprozip.merge import merge_pack_files
def _creat... | [
"tarfile.open",
"neurodocker.reprozip.trace.ReproZipMinimizer",
"os.path.join",
"neurodocker.docker.client.containers.run",
"tempfile.mkdtemp",
"glob.glob",
"neurodocker.reprozip.merge.merge_pack_files"
] | [((439, 543), 'neurodocker.docker.client.containers.run', 'client.containers.run', (['"""debian:stretch"""'], {'detach': '(True)', 'tty': '(True)', 'security_opt': "['seccomp:unconfined']"}), "('debian:stretch', detach=True, tty=True, security_opt\n =['seccomp:unconfined'])\n", (460, 543), False, 'from neurodocker.d... |
"""
HTML5 contexts.
:author: <NAME>
:license: MIT
"""
import contextlib
import io
import sys
__all__ = ['create_document', 'tag', 'as_link']
class create_document(contextlib.redirect_stdout):
"""Redirect output to an HTML5 document specified by new_target.
A HTML document title can ... | [
"contextlib.redirect_stdout.__enter__",
"contextlib.closing"
] | [((847, 889), 'contextlib.redirect_stdout.__enter__', 'contextlib.redirect_stdout.__enter__', (['self'], {}), '(self)\n', (883, 889), False, 'import contextlib\n'), ((2291, 2327), 'contextlib.closing', 'contextlib.closing', (['self._new_target'], {}), '(self._new_target)\n', (2309, 2327), False, 'import contextlib\n')] |
import torch
import torch.nn as nn
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.metrics import *
from sklearn.metrics import precision_recall_fscore_support as prfs
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
d... | [
"matplotlib.pyplot.savefig",
"matplotlib.use",
"torch.LongTensor",
"pandas.DataFrame.from_dict",
"torch.zeros",
"torch.cuda.is_available",
"torch.no_grad",
"torch.cuda.empty_cache",
"torch.randn"
] | [((72, 93), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (86, 93), False, 'import matplotlib\n'), ((6334, 6356), 'torch.LongTensor', 'torch.LongTensor', (['docs'], {}), '(docs)\n', (6350, 6356), False, 'import torch\n'), ((8097, 8128), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['... |
from xml.etree import ElementTree
from casexml.apps.case.tests.util import check_xml_line_by_line
from casexml.apps.case.xml import V2
from corehq.apps.fixtures import fixturegenerators
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType, FixtureOwnership, FixtureTypeField, \
FixtureItemField, ... | [
"corehq.apps.users.models.CommCareUser.create",
"xml.etree.ElementTree.tostring",
"corehq.apps.fixtures.fixturegenerators.item_lists",
"corehq.apps.fixtures.models.FixtureDataItem.by_user",
"corehq.apps.fixtures.models.FixtureOwnership",
"corehq.apps.fixtures.models.FixtureDataItem.get_indexed_items",
"... | [((2589, 2641), 'corehq.apps.users.models.CommCareUser.create', 'CommCareUser.create', (['self.domain', '"""to_delete"""', '"""***"""'], {}), "(self.domain, 'to_delete', '***')\n", (2608, 2641), False, 'from corehq.apps.users.models import CommCareUser\n'), ((2676, 2799), 'corehq.apps.fixtures.models.FixtureOwnership',... |
# -*- coding: utf-8 -*-
"""We define custom Django signals to trigger before executing searches."""
from django.db.models.signals import post_save, pre_delete
from django.dispatch import receiver
from django_elasticsearch_dsl.apps import DEDConfig
from readthedocs.projects.models import HTMLFile, Project
from readthe... | [
"readthedocs.search.tasks.delete_objects_in_es",
"django_elasticsearch_dsl.apps.DEDConfig.autosync_enabled",
"readthedocs.search.tasks.index_objects_to_es.delay",
"django.dispatch.receiver",
"readthedocs.search.tasks.index_objects_to_es"
] | [((466, 509), 'django.dispatch.receiver', 'receiver', (['bulk_post_create'], {'sender': 'HTMLFile'}), '(bulk_post_create, sender=HTMLFile)\n', (474, 509), False, 'from django.dispatch import receiver\n'), ((1001, 1044), 'django.dispatch.receiver', 'receiver', (['bulk_post_delete'], {'sender': 'HTMLFile'}), '(bulk_post_... |
import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from typing import Any, Dict, List
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
from pip._internal.... | [
"pip._internal.utils.logging.get_indentation",
"itertools.cycle",
"signal.signal",
"pip._vendor.colorama.AnsiToWin32",
"pip._internal.utils.misc.format_size"
] | [((2720, 2754), 'signal.signal', 'signal', (['SIGINT', 'self.handle_sigint'], {}), '(SIGINT, self.handle_sigint)\n', (2726, 2754), False, 'from signal import SIGINT, default_int_handler, signal\n'), ((3534, 3571), 'signal.signal', 'signal', (['SIGINT', 'self.original_handler'], {}), '(SIGINT, self.original_handler)\n',... |
import unittest
import datetime
from dida import schemas, triggers
from marshmallow import ValidationError
class TestTriggerSchema(unittest.TestCase):
def test_dump_trigger(self):
result = schemas.TriggerSchema().dump(triggers.IntervalTrigger())
print('IntervalTrigger dump:', result)
res... | [
"dida.triggers.IntervalTrigger",
"datetime.datetime",
"dida.triggers.DateTrigger",
"dida.schemas.TriggerSchema"
] | [((233, 259), 'dida.triggers.IntervalTrigger', 'triggers.IntervalTrigger', ([], {}), '()\n', (257, 259), False, 'from dida import schemas, triggers\n'), ((355, 377), 'dida.triggers.DateTrigger', 'triggers.DateTrigger', ([], {}), '()\n', (375, 377), False, 'from dida import schemas, triggers\n'), ((204, 227), 'dida.sche... |
# -*- coding: utf-8 -*-
"""
Example to train and evaluate a model with given data
@author: <NAME> <<EMAIL>>
"""
from cornac.data import Reader
from cornac.eval_methods import BaseMethod
from cornac.models import MF
from cornac.metrics import MAE, RMSE
from cornac.utils import cache
# Download MovieLens 100K provide... | [
"cornac.utils.cache",
"cornac.models.MF",
"cornac.metrics.MAE",
"cornac.eval_methods.BaseMethod.from_splits",
"cornac.data.Reader",
"cornac.metrics.RMSE"
] | [((356, 364), 'cornac.data.Reader', 'Reader', ([], {}), '()\n', (362, 364), False, 'from cornac.data import Reader\n'), ((581, 689), 'cornac.eval_methods.BaseMethod.from_splits', 'BaseMethod.from_splits', ([], {'train_data': 'train_data', 'test_data': 'test_data', 'exclude_unknowns': '(False)', 'verbose': '(True)'}), '... |
import os
import numpy as np
import cv2
import albumentations
from PIL import Image
from torch.utils.data import Dataset
from taming.data.sflckr import SegmentationBase # for examples included in repo
class Examples(SegmentationBase):
def __init__(self, size=256, random_crop=False, interpolation="bicubic"):
... | [
"numpy.eye",
"PIL.Image.open",
"os.path.join",
"albumentations.RandomCrop",
"numpy.array",
"albumentations.CenterCrop",
"albumentations.SmallestMaxSize"
] | [((3811, 3844), 'PIL.Image.open', 'Image.open', (["example['file_path_']"], {}), "(example['file_path_'])\n", (3821, 3844), False, 'from PIL import Image\n'), ((4090, 4131), 'PIL.Image.open', 'Image.open', (["example['segmentation_path_']"], {}), "(example['segmentation_path_'])\n", (4100, 4131), False, 'from PIL impor... |
import re
from model.contact import Contact
def test_all_contacts(app, db):
contacts_from_db = db.get_contact_list()
phone_list_from_db = db.phones_from_db()
#email_liset_from_db = db.emails_from_db()
phone_list = []
for phone in phone_list_from_db:
phone_list.append(merge_phones_like_on_h... | [
"re.sub"
] | [((918, 941), 're.sub', 're.sub', (['"""[() -]"""', '""""""', 's'], {}), "('[() -]', '', s)\n", (924, 941), False, 'import re\n'), ((977, 997), 're.sub', 're.sub', (['""" +"""', '""" """', 's'], {}), "(' +', ' ', s)\n", (983, 997), False, 'import re\n')] |
from discord.ext import commands
import json
import random
with open("assets/json/questions.json") as data:
data = json.load(data)
dares = data["dares"]
class Dare(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["d"])
async def dare(self, ctx):... | [
"json.load",
"random.choice",
"discord.ext.commands.command"
] | [((121, 136), 'json.load', 'json.load', (['data'], {}), '(data)\n', (130, 136), False, 'import json\n'), ((258, 289), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['d']"}), "(aliases=['d'])\n", (274, 289), False, 'from discord.ext import commands\n'), ((336, 356), 'random.choice', 'random.choic... |
# -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:<EMAIL>
#
# This program 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 2 of t... | [
"logilab.common.vcgutils.VCGPrinter",
"logilab.common.graph.DotBackend",
"pylint.pyreverse.utils.is_exception"
] | [((4475, 4521), 'logilab.common.graph.DotBackend', 'DotBackend', (['basename'], {'additionnal_param': 'layout'}), '(basename, additionnal_param=layout)\n', (4485, 4521), False, 'from logilab.common.graph import DotBackend\n'), ((5148, 5170), 'pylint.pyreverse.utils.is_exception', 'is_exception', (['obj.node'], {}), '(o... |
import logging
from ariadne import MutationType, convert_kwargs_to_snake_case
from config import clients, messages, queue
mutation = MutationType()
@mutation.field("createMessage")
@convert_kwargs_to_snake_case
async def resolve_create_message(obj, info, content, client_id):
try:
message = {"content": co... | [
"config.messages.append",
"ariadne.MutationType",
"config.clients.get",
"config.queue.put",
"logging.info"
] | [((134, 148), 'ariadne.MutationType', 'MutationType', ([], {}), '()\n', (146, 148), False, 'from ariadne import MutationType, convert_kwargs_to_snake_case\n'), ((359, 383), 'config.messages.append', 'messages.append', (['message'], {}), '(message)\n', (374, 383), False, 'from config import clients, messages, queue\n'),... |
import time
import sys
import pkg_resources
import os
import retrying
from sqlalchemy.exc import IntegrityError
# anchore modules
import anchore_engine.clients.services.common
import anchore_engine.subsys.servicestatus
import anchore_engine.subsys.metrics
from anchore_engine.subsys import logger
from anchore_engine.c... | [
"anchore_engine.db.DistroMapping",
"anchore_engine.subsys.logger.exception",
"anchore_engine.clients.services.internal_client_for",
"os.getenv",
"anchore_engine.subsys.logger.info",
"anchore_engine.clients.services.simplequeue.run_target_with_queue_ttl",
"sys.exit",
"anchore_engine.subsys.logger.error... | [((9137, 9318), 'retrying.retry', 'retrying.retry', ([], {'stop_max_attempt_number': 'FEED_SYNC_RETRIES', 'wait_incrementing_start': '(FEED_SYNC_RETRY_BACKOFF * 1000)', 'wait_incrementing_increment': '(FEED_SYNC_RETRY_BACKOFF * 1000)'}), '(stop_max_attempt_number=FEED_SYNC_RETRIES,\n wait_incrementing_start=FEED_SYN... |
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
import time
import numpy as np
import random
from collections import OrderedDict
import torch
import torch.backends.cudnn as cudnn
from callbacks import AverageMeter
from data_utils.causal_data_loader_frames import VideoFolder
from utils impo... | [
"torch.nn.CrossEntropyLoss",
"utils.save_results",
"numpy.array",
"model.model_lib.BboxInteractionLatentModel",
"argparse.ArgumentParser",
"model.model_lib.BboxVisualModel",
"numpy.linspace",
"numpy.concatenate",
"model.model_lib.ConcatFusionModel",
"callbacks.AverageMeter",
"os.path.isfile",
... | [((371, 428), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Counterfactual CAR"""'}), "(description='Counterfactual CAR')\n", (394, 428), False, 'import argparse\n'), ((6328, 6342), 'model.model_lib.BboxVisualModel', 'RGBModel', (['args'], {}), '(args)\n', (6336, 6342), True, 'from mode... |
# encoding: utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
import logging
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
app.config.from_object('config.current')
db = SQLAlchemy(app)
logger = logging.getLogger(__name__)
log... | [
"logging.getLogger",
"flask_sqlalchemy.SQLAlchemy",
"flask_cors.CORS",
"flask.Flask"
] | [((144, 159), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (149, 159), False, 'from flask import Flask\n'), ((161, 206), 'flask_cors.CORS', 'CORS', (['app'], {'resources': "{'/*': {'origins': '*'}}"}), "(app, resources={'/*': {'origins': '*'}})\n", (165, 206), False, 'from flask_cors import CORS\n'), ((2... |
from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
import os
import shutil
from genomicode import filelib
... | [
"Betsy.module_utils.get_inputid",
"os.listdir",
"os.path.join",
"shutil.copyfile",
"genomicode.filelib.exists_nz",
"Module.AbstractModule.__init__"
] | [((97, 126), 'Module.AbstractModule.__init__', 'AbstractModule.__init__', (['self'], {}), '(self)\n', (120, 126), False, 'from Module import AbstractModule\n'), ((368, 398), 'os.listdir', 'os.listdir', (['in_data.identifier'], {}), '(in_data.identifier)\n', (378, 398), False, 'import os\n'), ((638, 664), 'genomicode.fi... |
import unittest
import base
class Test(base.BaseScriptTest, unittest.TestCase):
command_line = "./scripts/maf_extract_ranges_indexed.py ./test_data/maf_tests/mm8_chr7_tiny.maf -c -m 5 -p mm8."
input_stdin = base.TestFile(filename="./test_data/maf_tests/dcking_ghp074.bed")
output_stdout = base.TestFile(fi... | [
"base.TestFile"
] | [((218, 283), 'base.TestFile', 'base.TestFile', ([], {'filename': '"""./test_data/maf_tests/dcking_ghp074.bed"""'}), "(filename='./test_data/maf_tests/dcking_ghp074.bed')\n", (231, 283), False, 'import base\n'), ((304, 369), 'base.TestFile', 'base.TestFile', ([], {'filename': '"""./test_data/maf_tests/dcking_ghp074.maf... |
# 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, software
# d... | [
"mock.patch.object",
"mock.MagicMock",
"nova.context.RequestContext",
"nova.service_auth.get_auth_plugin"
] | [((1027, 1087), 'mock.patch.object', 'mock.patch.object', (['ks_loading', '"""load_auth_from_conf_options"""'], {}), "(ks_loading, 'load_auth_from_conf_options')\n", (1044, 1087), False, 'import mock\n'), ((1375, 1435), 'mock.patch.object', 'mock.patch.object', (['ks_loading', '"""load_auth_from_conf_options"""'], {}),... |
import svhn2mnist
import usps
import syn2gtrsb
import syndig2svhn
def Generator(source, target, pixelda=False):
if source == 'usps' or target == 'usps':
return usps.Feature()
elif source == 'svhn':
return svhn2mnist.Feature()
elif source == 'synth':
return syn2gtrsb.Feature()
def ... | [
"syn2gtrsb.Feature",
"svhn2mnist.Feature",
"syn2gtrsb.Predictor",
"usps.Predictor",
"svhn2mnist.Predictor",
"usps.Feature"
] | [((173, 187), 'usps.Feature', 'usps.Feature', ([], {}), '()\n', (185, 187), False, 'import usps\n'), ((408, 424), 'usps.Predictor', 'usps.Predictor', ([], {}), '()\n', (422, 424), False, 'import usps\n'), ((465, 487), 'svhn2mnist.Predictor', 'svhn2mnist.Predictor', ([], {}), '()\n', (485, 487), False, 'import svhn2mnis... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | [
"unittest.TestSuite",
"Products.CMFCore.DirectoryView._dirreg.getDirectoryInfo",
"Products.CMFCore.DirectoryView.registerDirectory",
"unittest.makeSuite",
"os.path.join",
"warnings.catch_warnings",
"Products.CMFCore.DirectoryView._generateKey",
"Products.CMFCore.DirectoryView.addDirectoryViews",
"te... | [((11700, 11720), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (11718, 11720), False, 'import unittest\n'), ((1418, 1459), 'Products.CMFCore.DirectoryView.registerDirectory', 'registerDirectory', (['"""fake_skins"""', '_globals'], {}), "('fake_skins', _globals)\n", (1435, 1459), False, 'from Products.C... |
import openmdao.api as om
from pycycle.thermo.cea import species_data
from pycycle.constants import AIR_ELEMENTS
from pycycle.elements.ambient import Ambient
from pycycle.elements.flow_start import FlowStart
class FlightConditions(om.Group):
"""Determines total and static flow properties given an altitude and Ma... | [
"openmdao.api.IndepVarComp",
"pycycle.elements.ambient.Ambient",
"openmdao.api.Group",
"openmdao.api.BalanceComp",
"openmdao.api.DirectSolver",
"openmdao.api.NewtonSolver",
"pycycle.elements.flow_start.FlowStart",
"openmdao.api.BoundsEnforceLS",
"openmdao.api.Problem"
] | [((3148, 3160), 'openmdao.api.Problem', 'om.Problem', ([], {}), '()\n', (3158, 3160), True, 'import openmdao.api as om\n'), ((3176, 3186), 'openmdao.api.Group', 'om.Group', ([], {}), '()\n', (3184, 3186), True, 'import openmdao.api as om\n'), ((2177, 2194), 'openmdao.api.NewtonSolver', 'om.NewtonSolver', ([], {}), '()\... |
# Lint as: python3
# coding=utf-8
# Copyright 2019 The TensorFlow 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/LICE... | [
"os.path.exists",
"random.shuffle",
"os.makedirs",
"data_split.write_data",
"data_split.read_data",
"random.seed"
] | [((1405, 1420), 'random.seed', 'random.seed', (['(30)'], {}), '(30)\n', (1416, 1420), False, 'import random\n'), ((1425, 1451), 'random.shuffle', 'random.shuffle', (['whole_data'], {}), '(whole_data)\n', (1439, 1451), False, 'import random\n'), ((2055, 2088), 'data_split.read_data', 'read_data', (['"""./data/complete_d... |
from datetime import datetime
from kubernetes import client
from kubernetes.client.rest import ApiException
import os
import time
import yaml
from tests import config as conf
import tests.utils as ut
def remove_clusterrole_binding(shipper_name, crb_name):
# remove clusterrolebind
k8s_client = client.RbacAuth... | [
"kubernetes.client.CoreV1Api",
"tests.utils.duplicate_file_and_replace_phrases",
"os.path.join",
"time.sleep",
"datetime.datetime.now",
"yaml.safe_load",
"kubernetes.client.AppsV1Api",
"kubernetes.client.RbacAuthorizationV1Api",
"kubernetes.client.PolicyV1beta1Api",
"tests.utils.delete_file"
] | [((305, 336), 'kubernetes.client.RbacAuthorizationV1Api', 'client.RbacAuthorizationV1Api', ([], {}), '()\n', (334, 336), False, 'from kubernetes import client\n'), ((9695, 9709), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (9707, 9709), False, 'from datetime import datetime\n'), ((2378, 2510), 'tests.uti... |
import os
from dotenv import load_dotenv
class Config:
# Current Version
NATLAS_VERSION = "0.6.10"
BASEDIR = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(BASEDIR, '.env'))
def get_int(self, varname):
tmp = os.environ.get(varname)
if tmp:
return int(tmp)
return None
def get_bo... | [
"os.path.dirname",
"os.path.join",
"os.environ.get"
] | [((132, 157), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (147, 157), False, 'import os\n'), ((172, 201), 'os.path.join', 'os.path.join', (['BASEDIR', '""".env"""'], {}), "(BASEDIR, '.env')\n", (184, 201), False, 'import os\n'), ((241, 264), 'os.environ.get', 'os.environ.get', (['varname']... |
import os
import sys
import click
import pickle
import sncosmo
import numpy as np
from astropy.table import Table
DATA_PATH = '/home/samdixon/jla_light_curves/'
def modify_error(lc, error_floor=0.):
"""Add an error floor of `error_floor` times the maximum flux of the band
to each observation
"""
... | [
"numpy.mean",
"sncosmo.fit_lc",
"numpy.sqrt",
"os.listdir",
"astropy.table.Table",
"os.makedirs",
"os.path.join",
"numpy.max",
"os.path.isdir",
"sncosmo.select_data",
"sncosmo.CCM89Dust",
"sys.stdout.flush",
"sncosmo.photdata.photometric_data"
] | [((841, 868), 'astropy.table.Table', 'Table', (['new_lc'], {'meta': 'lc.meta'}), '(new_lc, meta=lc.meta)\n', (846, 868), False, 'from astropy.table import Table\n'), ((693, 720), 'numpy.max', 'np.max', (['data.flux[band_cut]'], {}), '(data.flux[band_cut])\n', (699, 720), True, 'import numpy as np\n'), ((759, 835), 'num... |
""" Unit tests for the system interface."""
import unittest
from six import assertRaisesRegex
from six.moves import cStringIO
import numpy as np
from openmdao.api import Problem, Group, IndepVarComp, ExecComp
from openmdao.test_suite.components.options_feature_vector import VectorDoublingComp
from openmdao.utils.ass... | [
"openmdao.utils.assert_utils.assert_rel_error",
"openmdao.api.ExecComp",
"numpy.ones",
"openmdao.utils.assert_utils.assert_warning",
"openmdao.test_suite.scripts.circuit_analysis.Circuit",
"openmdao.api.IndepVarComp",
"openmdao.api.Group",
"numpy.zeros",
"six.assertRaisesRegex",
"unittest.main",
... | [((10995, 11010), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11008, 11010), False, 'import unittest\n'), ((467, 474), 'openmdao.api.Group', 'Group', ([], {}), '()\n', (472, 474), False, 'from openmdao.api import Problem, Group, IndepVarComp, ExecComp\n'), ((698, 705), 'openmdao.api.Group', 'Group', ([], {}), ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import sqlite3
import sys
import pandas as pd
from src import config
def parse_args(argv):
parser = argparse.ArgumentParser()
parser.add_argument('sample')
parser.add_argument('replace')
return parser.parse_args()
def db_table... | [
"sqlite3.connect",
"argparse.ArgumentParser",
"pandas.read_csv",
"os.path.join",
"pandas.read_sql"
] | [((180, 205), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (203, 205), False, 'import argparse\n'), ((380, 437), 'pandas.read_sql', 'pd.read_sql', (['"""select name from sqlite_master"""', 'connection'], {}), "('select name from sqlite_master', connection)\n", (391, 437), True, 'import pandas... |
# coding: utf-8
import pytest
import app as service
import yaml
import responder
from starlette.responses import PlainTextResponse
@pytest.fixture
def api():
return service.api
def test_hello_world(api):
r = api.requests.get("/api/v1.0/index")
assert r.text == "Hello, World!"
def test_basic_route(api... | [
"time.sleep",
"yaml.load",
"starlette.responses.PlainTextResponse"
] | [((993, 1013), 'yaml.load', 'yaml.load', (['r.content'], {}), '(r.content)\n', (1002, 1013), False, 'import yaml\n'), ((1366, 1408), 'starlette.responses.PlainTextResponse', 'PlainTextResponse', (['"""Suppressed error"""', '(500)'], {}), "('Suppressed error', 500)\n", (1383, 1408), False, 'from starlette.responses impo... |
# -*- coding: utf-8 -*-
"""
Script to execute example covarying MMGP regression forecasting model
with full Krhh.
Inputs: Data training and test sets (dictionary pickle)
Data for example:
- normalised solar data for 25 sites for 15 minute forecast
- N_train = 4200, N_test = 2276, P = 25, D = 51
- Xtr[:, :5... | [
"mmgp.ExplicitSCMMGP",
"mmgp.losses.MeanAbsError",
"numpy.mean",
"mmgp.kernels.PeriodicSliceFixed",
"mmgp.util.util.get_flags",
"numpy.concatenate",
"tensorflow.train.AdamOptimizer",
"mmgp.kernels.RadialBasisSlice",
"csv.writer",
"pickle.load",
"numpy.savetxt",
"mmgp.kernels.CompactSlice",
"... | [((2670, 2691), 'mmgp.util.util.get_flags', 'util.util.get_flags', ([], {}), '()\n', (2689, 2691), False, 'from mmgp import util\n'), ((6258, 6331), 'mmgp.likelihoods.CovaryingRegressionNetwork', 'likelihoods.CovaryingRegressionNetwork', (['output_dim', 'node_dim'], {'std_dev': '(0.2)'}), '(output_dim, node_dim, std_de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date: 10-02-2018
"""ExpandRank keyphrase extraction model.
Graph-based ranking approach to keyphrase extraction described in:
* <NAME> and <NAME>.
Single Document Keyphrase Extraction Using Neighborhood Knowledge.
*In proceedings of AAAI*, pages 85... | [
"onmt.keyphrase.pke.base.LoadFile",
"logging.warning",
"networkx.pagerank_scipy"
] | [((3217, 3227), 'onmt.keyphrase.pke.base.LoadFile', 'LoadFile', ([], {}), '()\n', (3225, 3227), False, 'from onmt.keyphrase.pke.base import LoadFile\n'), ((5889, 5947), 'networkx.pagerank_scipy', 'nx.pagerank_scipy', (['self.graph'], {'alpha': '(0.85)', 'weight': '"""weight"""'}), "(self.graph, alpha=0.85, weight='weig... |
import json
import inspect
import hashlib
from _plotly_utils.utils import PlotlyJSONEncoder
from dash.long_callback.managers import BaseLongCallbackManager
class CeleryLongCallbackManager(BaseLongCallbackManager):
def __init__(self, celery_app, cache_by=None, expire=None):
"""
Long callback manag... | [
"json.loads",
"json.dumps",
"inspect.getsource"
] | [((4202, 4223), 'inspect.getsource', 'inspect.getsource', (['fn'], {}), '(fn)\n', (4219, 4223), False, 'import inspect\n'), ((3614, 3632), 'json.loads', 'json.loads', (['result'], {}), '(result)\n', (3624, 3632), False, 'import json\n'), ((3298, 3323), 'json.loads', 'json.loads', (['progress_data'], {}), '(progress_dat... |
# 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.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
"msrest.Serializer",
"msrest.Deserializer"
] | [((1681, 1706), 'msrest.Serializer', 'Serializer', (['client_models'], {}), '(client_models)\n', (1691, 1706), False, 'from msrest import Serializer, Deserializer\n'), ((1735, 1762), 'msrest.Deserializer', 'Deserializer', (['client_models'], {}), '(client_models)\n', (1747, 1762), False, 'from msrest import Serializer,... |
"""
Copyright 2019 Samsung SDS
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 ... | [
"brightics.common.exception.BrighticsFunctionException.from_errors",
"brightics.common.utils.check_required_parameters",
"re.compile"
] | [((820, 872), 'brightics.common.utils.check_required_parameters', 'check_required_parameters', (['_regex', 'params', "['table']"], {}), "(_regex, params, ['table'])\n", (845, 872), False, 'from brightics.common.utils import check_required_parameters\n'), ((2179, 2202), 're.compile', 're.compile', (['raw_pattern'], {}),... |
#!/usr/bin/env python3
import sys
import os
import logging
import numpy as np
import pandas as pd
import dateutil
def tempF2C(x): return (x-32.0)*5.0/9.0
def tempC2F(x): return (x*9.0/5.0)+32.0
def load_temperature_hdf5(temps_fn, local_time_offset, basedir=None, start_year=None, truncate_to_full_day=False):
## ... | [
"pandas.Series",
"pandas.isnull",
"pandas.read_csv",
"numpy.arange",
"numpy.searchsorted",
"pandas.Timedelta",
"os.path.join",
"numpy.arcsin",
"dateutil.tz.tzoffset",
"pandas.read_hdf",
"numpy.isnan",
"numpy.cos",
"pandas.concat",
"pandas.to_datetime"
] | [((562, 592), 'pandas.read_hdf', 'pd.read_hdf', (['temps_fn', '"""table"""'], {}), "(temps_fn, 'table')\n", (573, 592), True, 'import pandas as pd\n'), ((688, 732), 'dateutil.tz.tzoffset', 'dateutil.tz.tzoffset', (['local_time_offset', 'tmp'], {}), '(local_time_offset, tmp)\n', (708, 732), False, 'import dateutil\n'), ... |
# import Kratos
import KratosMultiphysics
import KratosMultiphysics.StructuralMechanicsApplication as StructuralMechanicsApplication
import KratosMultiphysics.CSharpWrapperApplication as CSharpWrapperApplication
import run_cpp_unit_tests
# Import Kratos "wrapper" for unittests
import KratosMultiphysics.KratosUnittest ... | [
"KratosMultiphysics.kratos_utilities.CheckIfApplicationsAvailable",
"KratosMultiphysics.Logger.PrintInfo",
"run_cpp_unit_tests.run"
] | [((469, 544), 'KratosMultiphysics.kratos_utilities.CheckIfApplicationsAvailable', 'kratos_utilities.CheckIfApplicationsAvailable', (['"""ExternalSolversApplication"""'], {}), "('ExternalSolversApplication')\n", (514, 544), True, 'import KratosMultiphysics.kratos_utilities as kratos_utilities\n'), ((2172, 2259), 'Kratos... |
# -*- coding: utf-8 -*-
import pytest
import datetime
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from rest_framework.test import APIClient, APIRequestFactory
from resources.enums import UnitAuthorizationLevel
from resources.models import Resource, ResourceType, Unit, Pu... | [
"resources.models.ResourceEquipment.objects.create",
"resources.models.Equipment.objects.create",
"rest_framework.test.APIClient",
"pytest.fixture",
"datetime.timedelta",
"resources.models.Period.objects.create",
"resources.models.AccessibilityViewpoint.objects.create",
"resources.models.UnitAccessibi... | [((970, 1021), 'pytest.fixture', 'pytest.fixture', ([], {'params': "[None, 'user', 'staff_user']"}), "(params=[None, 'user', 'staff_user'])\n", (984, 1021), False, 'import pytest\n'), ((660, 671), 'rest_framework.test.APIClient', 'APIClient', ([], {}), '()\n', (669, 671), False, 'from rest_framework.test import APIClie... |
from enum import Enum
from window import Window
D = Enum ('Directions','N NE E SE S SW W NW')
selector_map = {
D.NW: [0.5,0.5], D.N: [1.5,0], D.NE: [2.5,0.5],
D.W: [0,1.5], D.E: [3,1.5],
D.SW: [0.5,2.5], D.S: [1.5,3], D.SE: [2.5,2.5],
}
selector_size = 100
window_si... | [
"window.Window",
"functools.partial",
"enum.Enum"
] | [((53, 94), 'enum.Enum', 'Enum', (['"""Directions"""', '"""N NE E SE S SW W NW"""'], {}), "('Directions', 'N NE E SE S SW W NW')\n", (57, 94), False, 'from enum import Enum\n'), ((351, 427), 'window.Window', 'Window', (['window_size', 'window_size', 'selector_map', 'selector_size', 'selector_size'], {}), '(window_size,... |
# coding=utf-8
#!/usr/bin/env python3
from libs.check_modules import check_modules
from sys import exit
from os import _exit
check_modules()
from os import path
from libs.logo import print_logo
from libs.utils import print_success
from libs.utils import print_error
from libs.utils import ask_question
... | [
"libs.attack.report_profile_attack",
"libs.utils.print_success",
"libs.attack.report_video_attack",
"libs.utils.print_error",
"libs.utils.print_status",
"multiprocessing.Process",
"libs.utils.ask_question",
"libs.check_modules.check_modules",
"libs.logo.print_logo",
"os._exit",
"libs.utils.parse... | [((134, 149), 'libs.check_modules.check_modules', 'check_modules', ([], {}), '()\n', (147, 149), False, 'from libs.check_modules import check_modules\n'), ((1323, 1385), 'libs.utils.ask_question', 'ask_question', (['"""Enter the link of the video you want to report"""'], {}), "('Enter the link of the video you want to ... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
NumPy Array Editor Dialog based on Qt
"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
# Stand... | [
"qtpy.QtWidgets.QComboBox",
"spyder.utils.qthelpers.add_actions",
"qtpy.QtWidgets.QGridLayout",
"spyder.py3compat.to_text_string",
"spyder.utils.qthelpers.keybinding",
"numpy.array",
"spyder.py3compat.to_binary_string",
"qtpy.QtWidgets.QDialog.accept",
"spyder.py3compat.is_binary_string",
"spyder.... | [((20131, 20137), 'qtpy.QtCore.Slot', 'Slot', ([], {}), '()\n', (20135, 20137), False, 'from qtpy.QtCore import QAbstractTableModel, QItemSelection, QLocale, QItemSelectionRange, QModelIndex, Qt, Slot\n'), ((30224, 30254), 'qtpy.QtCore.Slot', 'Slot', (['QModelIndex', 'QModelIndex'], {}), '(QModelIndex, QModelIndex)\n',... |
""" Defines the PolygonPlot class.
"""
from __future__ import with_statement
# Major library imports
import numpy as np
# Enthought library imports.
from enable.api import LineStyle, black_color_trait, \
transparent_color_trait
from kiva.agg import points_in_polygon
from traits.api ... | [
"traits.api.Enum",
"traits.api.on_trait_change",
"traits.api.Property",
"kiva.agg.points_in_polygon",
"base_xy_plot.BaseXYPlot.hittest",
"numpy.array",
"numpy.vstack",
"traits.api.Float"
] | [((1659, 1669), 'traits.api.Float', 'Float', (['(1.0)'], {}), '(1.0)\n', (1664, 1669), False, 'from traits.api import Enum, Float, Tuple, Property, cached_property, on_trait_change\n'), ((1923, 1952), 'traits.api.Enum', 'Enum', (['"""poly"""', '"""point"""', '"""line"""'], {}), "('poly', 'point', 'line')\n", (1927, 195... |
import os
from datetime import timedelta
basedir = os.path.abspath(os.path.dirname(__file__))
API_DATA_URL = "https://invest-public-api.tinkoff.ru/rest/tinkoff.public.invest.api.contract.v1.InstrumentsService/"
API_LASTPRICES_URL = "https://invest-public-api.tinkoff.ru/rest/\
tinkoff.public.invest.api.contract.v1.Mar... | [
"os.path.dirname",
"datetime.timedelta",
"os.path.join"
] | [((461, 478), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (470, 478), False, 'from datetime import timedelta\n'), ((68, 93), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (83, 93), False, 'import os\n'), ((392, 432), 'os.path.join', 'os.path.join', (['basedir', '"... |
import threading
from multiprocessing import Queue
results = []
results2 = []
def take_numbers(q):
print('Enter the numbers:')
for i in range(0,3):
num1 = int(input('Enter first number: '))
num2 = int(input('Enter second number: '))
q.put(num1)
q.put(num2)
def add_num(q):
... | [
"threading.Thread",
"multiprocessing.Queue"
] | [((464, 471), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (469, 471), False, 'from multiprocessing import Queue\n'), ((477, 520), 'threading.Thread', 'threading.Thread', ([], {'target': 'add_num', 'args': '(q,)'}), '(target=add_num, args=(q,))\n', (493, 520), False, 'import threading\n'), ((527, 575), 'threadin... |
import os
import os.path as osp
import numpy as np
from joblib import Parallel, delayed
from tensorflow.keras.utils import get_file
from tqdm import tqdm
from spektral.data import Dataset, Graph
from spektral.utils import label_to_one_hot, sparse
from spektral.utils.io import load_csv, load_sdf
ATOM_TYPES = [1, 6, 7... | [
"spektral.utils.io.load_sdf",
"spektral.utils.label_to_one_hot",
"numpy.ones_like",
"spektral.utils.io.load_csv",
"tqdm.tqdm",
"os.path.join",
"joblib.Parallel",
"numpy.array",
"tensorflow.keras.utils.get_file",
"numpy.concatenate",
"joblib.delayed",
"spektral.data.Graph"
] | [((2701, 2749), 'spektral.utils.label_to_one_hot', 'label_to_one_hot', (["atom['atomic_num']", 'ATOM_TYPES'], {}), "(atom['atomic_num'], ATOM_TYPES)\n", (2717, 2749), False, 'from spektral.utils import label_to_one_hot, sparse\n'), ((2840, 2895), 'numpy.concatenate', 'np.concatenate', (['(atomic_num, coords, [charge, i... |