code stringlengths 21 1.03M | apis list | extract_api stringlengths 74 8.23M |
|---|---|---|
import unittest
from find_word import search_word
path = 'D:\\test.txt'
file = open(path, 'w')
file.write('hello world')
file.close()
class TestSearch_word(unittest.TestCase):
a = search_word()
a.search('D', 'txt','hello')
def test_list(self):
b = self.a.list()
b = ''.join(b)... | [
"find_word.search_word",
"unittest.main"
] | [((195, 208), 'find_word.search_word', 'search_word', ([], {}), '()\n', (206, 208), False, 'from find_word import search_word\n'), ((585, 600), 'unittest.main', 'unittest.main', ([], {}), '()\n', (598, 600), False, 'import unittest\n')] |
#! /usr/bin/env python3
import json
from kafka import KafkaConsumer
stations = {}
consumer = KafkaConsumer("velib-stations", bootstrap_servers='localhost:9092',
group_id="velib-monitor-stations")
for message in consumer:
station = json.loads(message.value.decode())
station_number = sta... | [
"kafka.KafkaConsumer"
] | [((94, 200), 'kafka.KafkaConsumer', 'KafkaConsumer', (['"""velib-stations"""'], {'bootstrap_servers': '"""localhost:9092"""', 'group_id': '"""velib-monitor-stations"""'}), "('velib-stations', bootstrap_servers='localhost:9092',\n group_id='velib-monitor-stations')\n", (107, 200), False, 'from kafka import KafkaConsu... |
from .views import box
from django.urls import path
urlpatterns = [
path('<slug:label>/', box, name='box'),
]
| [
"django.urls.path"
] | [((73, 111), 'django.urls.path', 'path', (['"""<slug:label>/"""', 'box'], {'name': '"""box"""'}), "('<slug:label>/', box, name='box')\n", (77, 111), False, 'from django.urls import path\n')] |
# Copyright (c) 2022 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 applic... | [
"paddle.nn.functional.softmax",
"paddle.argmax"
] | [((886, 935), 'paddle.nn.functional.softmax', 'paddle.nn.functional.softmax', (['net_outputs'], {'axis': '(1)'}), '(net_outputs, axis=1)\n', (914, 935), False, 'import paddle\n'), ((1055, 1113), 'paddle.argmax', 'paddle.argmax', (['logit'], {'axis': '(1)', 'keepdim': '(False)', 'dtype': '"""int32"""'}), "(logit, axis=1... |
"""Browsing example using Selenium"""
from pathlib import Path
from selenium import webdriver
def get_project_root() -> Path:
"""Get project root path."""
return Path(__file__).parent.parent
def get_chrome_path() -> Path:
"""Get chrome driver path."""
root = get_project_root()
return root.joinpa... | [
"pathlib.Path"
] | [((172, 186), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (176, 186), False, 'from pathlib import Path\n')] |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
from gaiatest.apps.base import PageRegion
from gaiatest... | [
"gaiatest.apps.messages.app.Messages",
"gaiatest.apps.messages.regions.activities.Activities",
"gaiatest.apps.phone.regions.keypad.Keypad"
] | [((1174, 1199), 'gaiatest.apps.messages.app.Messages', 'Messages', (['self.marionette'], {}), '(self.marionette)\n', (1182, 1199), False, 'from gaiatest.apps.messages.app import Messages\n'), ((2111, 2138), 'gaiatest.apps.messages.regions.activities.Activities', 'Activities', (['self.marionette'], {}), '(self.marionett... |
#!/usr/bin/env python3
import pytest
import os
import pathlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import logging
import math
import torch
from neuralprophet import NeuralProphet, set_random_seed
from neuralprophet import df_utils
log = logging.getLogger("NP.test")
log.setLevel("WAR... | [
"neuralprophet.df_utils.split_considering_timestamp",
"neuralprophet.NeuralProphet",
"pandas.to_datetime",
"pathlib.Path",
"torch.abs",
"neuralprophet.df_utils.init_data_params",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.arange",
"neuralprophet.df_utils.check_dataframe",
"neuralprophet.df_ut... | [((274, 302), 'logging.getLogger', 'logging.getLogger', (['"""NP.test"""'], {}), "('NP.test')\n", (291, 302), False, 'import logging\n'), ((424, 463), 'os.path.join', 'os.path.join', (['DIR', '"""tests"""', '"""test-data"""'], {}), "(DIR, 'tests', 'test-data')\n", (436, 463), False, 'import os\n'), ((478, 529), 'os.pat... |
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import tempfile
from ansible_collections.c... | [
"os.path.join",
"ansible_collections.community.general.tests.unit.compat.mock.patch.object",
"os.path.dirname",
"tempfile.mkstemp",
"json.loads",
"os.remove"
] | [((519, 544), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (534, 544), False, 'import os\n'), ((613, 645), 'os.path.join', 'os.path.join', (['fixture_path', 'name'], {}), '(fixture_path, name)\n', (625, 645), False, 'import os\n'), ((786, 802), 'json.loads', 'json.loads', (['data'], {}), '(... |
import os
import numpy as np
from framework.utils import LockFile, U
from framework.visualize import plot
import functools
import torch
import torch.utils.data
import operator
from typing import List, Tuple, Optional, Dict, Any, Callable
from tqdm import tqdm
from dataclasses import dataclass
import torch.nn.functional... | [
"os.path.join",
"torch.load",
"framework.utils.LockFile",
"torch.save",
"numpy.random.RandomState",
"numpy.sum",
"numpy.sqrt",
"os.path.isfile",
"functools.reduce",
"numpy.isfinite",
"os.path.isdir",
"os.makedirs",
"numpy.expand_dims"
] | [((2278, 2336), 'functools.reduce', 'functools.reduce', (['operator.mul', 'self.data.images.shape[1:]'], {}), '(operator.mul, self.data.images.shape[1:])\n', (2294, 2336), False, 'import functools\n'), ((2932, 2967), 'os.path.join', 'os.path.join', (['cache', '"""mean_std.pth"""'], {}), "(cache, 'mean_std.pth')\n", (29... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('users', '0023_remove_userprofile_social_security_number'),
]
operations = [
migrations.RenameFi... | [
"django.db.models.DateTimeField",
"django.db.migrations.RenameField"
] | [((301, 396), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""invitation"""', 'old_name': '"""is_accepted"""', 'new_name': '"""is_used"""'}), "(model_name='invitation', old_name='is_accepted',\n new_name='is_used')\n", (323, 396), False, 'from django.db import migrations, models... |
import datetime
import hashlib
import logging
import os
import pprint
import textwrap
import pytest
import salt.utils.files
from tests.support.case import ModuleCase
from tests.support.helpers import with_tempfile
from tests.support.mixins import SaltReturnAssertsMixin
from tests.support.runtests import RUNTIME_VARS
f... | [
"os.path.join",
"tests.support.unit.skipIf",
"logging.getLogger",
"tests.support.helpers.with_tempfile",
"datetime.datetime.strptime",
"textwrap.dedent",
"datetime.datetime.now",
"os.path.exists",
"hashlib.sha1",
"pytest.mark.usefixtures",
"os.path.split",
"os.stat"
] | [((485, 512), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (502, 512), False, 'import logging\n'), ((516, 558), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""salt_sub_minion"""'], {}), "('salt_sub_minion')\n", (539, 558), False, 'import pytest\n'), ((560, 615), 'tests.supp... |
import json
from importlib import import_module
from pydantic import BaseModel
SCHEMA_MODELS_PACKAGE_BASE = "galaxy.schema."
# https://stackoverflow.com/a/2020083
def fullname(o):
klass = o.__class__
module = klass.__module__
if module == "builtins":
return klass.__qualname__ # avoid outputs li... | [
"json.loads",
"json.dumps",
"json.JSONEncoder.default",
"importlib.import_module"
] | [((1343, 1377), 'json.dumps', 'json.dumps', (['obj'], {'cls': 'SchemaEncoder'}), '(obj, cls=SchemaEncoder)\n', (1353, 1377), False, 'import json\n'), ((1433, 1476), 'json.loads', 'json.loads', (['obj'], {'object_hook': 'schema_decoder'}), '(obj, object_hook=schema_decoder)\n', (1443, 1476), False, 'import json\n'), ((6... |
import json
from selenium.common.exceptions import NoSuchElementException
from kiali.client import KialiClient
from kiali_qe.components.enums import (
IstioConfigObjectType as OBJECT_TYPE,
IstioConfigValidation,
OverviewPageType,
TimeIntervalRestParam,
HealthType as HEALTH_TYPE,
ItemIconType,
... | [
"selenium.common.exceptions.NoSuchElementException",
"kiali_qe.entities.applications.ApplicationHealth.get_from_rest",
"json.dumps",
"kiali_qe.entities.Requests",
"kiali_qe.utils.dict_to_params",
"kiali_qe.entities.service.VirtualServiceWeight",
"kiali_qe.entities.service.ServiceHealth.get_from_rest",
... | [((17061, 17099), 'selenium.common.exceptions.NoSuchElementException', 'NoSuchElementException', (["_data['error']"], {}), "(_data['error'])\n", (17083, 17099), False, 'from selenium.common.exceptions import NoSuchElementException\n'), ((33984, 34025), 'kiali_qe.entities.service.ServiceHealth.get_from_rest', 'ServiceHe... |
import json
import os.path
import pathlib
import gi
gi.require_versions({
'Gdk': '3.0',
'Gtk': '3.0',
})
from gi.repository import Gtk # noqa: E402 # need to call require_version before we can call this
class ProfileChooserWindow(Gtk.Window):
def __init__(self, completion_callback):
self.complet... | [
"pathlib.Path.home",
"gi.repository.Gtk.Dialog",
"gi.repository.Gtk.Entry",
"gi.require_versions",
"gi.repository.Gtk.Grid",
"json.dump",
"gi.repository.Gtk.Window.__init__",
"gi.repository.Gtk.MessageDialog",
"gi.repository.Gtk.Label",
"gi.repository.Gtk.Box",
"gi.repository.Gtk.Button.new_with... | [((53, 102), 'gi.require_versions', 'gi.require_versions', (["{'Gdk': '3.0', 'Gtk': '3.0'}"], {}), "({'Gdk': '3.0', 'Gtk': '3.0'})\n", (72, 102), False, 'import gi\n'), ((565, 623), 'gi.repository.Gtk.Window.__init__', 'Gtk.Window.__init__', (['self'], {'title': '"""Pi Cave profile chooser"""'}), "(self, title='Pi Cave... |
from sequencing_tools.bam_tools.bigwig import parse_depth_bed
def getopt(subparser):
parser = subparser.add_parser(
name="cov2bw",
description="Splitting genomecov bed into chromosomes and write to bigwig",
)
parser.add_argument(
"-i", "--infile", default="-", help="genomecov -d fi... | [
"sequencing_tools.bam_tools.bigwig.parse_depth_bed"
] | [((638, 695), 'sequencing_tools.bam_tools.bigwig.parse_depth_bed', 'parse_depth_bed', (['args.infile', 'args.genome', 'args.outprefix'], {}), '(args.infile, args.genome, args.outprefix)\n', (653, 695), False, 'from sequencing_tools.bam_tools.bigwig import parse_depth_bed\n')] |
"""Module to be used with jupyter notebook TES Trace Generator.
Contains:
1) extract_data
2) create_statistics_file
3) plot_traces
4) correct_xticks
5) correct_yticks
"""
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from tes.data import CaptureData
from tes.registers import load
d... | [
"matplotlib.pyplot.rc",
"numpy.log10",
"numpy.dtype",
"tes.data.CaptureData",
"numpy.memmap"
] | [((1121, 1142), 'tes.data.CaptureData', 'CaptureData', (['datapath'], {}), '(datapath)\n', (1132, 1142), False, 'from tes.data import CaptureData\n'), ((2282, 2432), 'numpy.dtype', 'np.dtype', (["[('ticks', 'u8'), ('events', 'u8'), ('traces', 'u8'), ('mca', 'u8'), (\n 'frames', 'u8'), ('dropped', 'u8'), ('bad', 'u8'... |
import numpy as np
import beluga.Beluga as Beluga
import beluga.bvpsol as bvpsol
import beluga.bvpsol.algorithms as algorithms
import beluga.optim.Problem
from beluga.optim.problem import *
from beluga.continuation import *
from math import *
from mock import *
import pytest
@pytest.fixture(scope='session')
def prob... | [
"pytest.fixture",
"beluga.bvpsol.algorithms.SingleShooting",
"beluga.bvpsol.Solution",
"beluga.bvpsol.BVP"
] | [((280, 311), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (294, 311), False, 'import pytest\n'), ((2795, 2826), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (2809, 2826), False, 'import pytest\n'), ((2986, 3017), 'pytest.fi... |
import textwrap
from contextlib import contextmanager
from testflows.core import *
from testflows.asserts import error
from aes_encryption.requirements import *
from aes_encryption.tests.common import mysql_modes, hex
@contextmanager
def dictionary(name, node, mysql_node, secret_type):
"""Create a table in MySQL... | [
"textwrap.dedent",
"testflows.asserts.error",
"aes_encryption.tests.common.hex"
] | [((1951, 1971), 'textwrap.dedent', 'textwrap.dedent', (['sql'], {}), '(sql)\n', (1966, 1971), False, 'import textwrap\n'), ((4233, 4253), 'textwrap.dedent', 'textwrap.dedent', (['sql'], {}), '(sql)\n', (4248, 4253), False, 'import textwrap\n'), ((6789, 6796), 'testflows.asserts.error', 'error', ([], {}), '()\n', (6794,... |
#!/usr/bin/env python
# Copyright 2016 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... | [
"google.cloud.pubsub_v1.PublisherClient",
"google.cloud.pubsub_v1.types.BatchSettings",
"argparse.ArgumentParser"
] | [((999, 1026), 'google.cloud.pubsub_v1.PublisherClient', 'pubsub_v1.PublisherClient', ([], {}), '()\n', (1024, 1026), False, 'from google.cloud import pubsub_v1\n'), ((1249, 1276), 'google.cloud.pubsub_v1.PublisherClient', 'pubsub_v1.PublisherClient', ([], {}), '()\n', (1274, 1276), False, 'from google.cloud import pub... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plane Visual
============
Defines the *Plane Visual*:
- :class:`PlaneVisual`
"""
from __future__ import division, unicode_literals
from vispy.geometry.generation import create_plane
from vispy.scene.visuals import create_visual_node
from colour_analysis.visuals ... | [
"colour_analysis.visuals.PrimitiveVisual.__init__",
"vispy.geometry.generation.create_plane",
"vispy.scene.visuals.create_visual_node"
] | [((2639, 2670), 'vispy.scene.visuals.create_visual_node', 'create_visual_node', (['PlaneVisual'], {}), '(PlaneVisual)\n', (2657, 2670), False, 'from vispy.scene.visuals import create_visual_node\n'), ((2237, 2308), 'vispy.geometry.generation.create_plane', 'create_plane', (['width', 'height', 'width_segments', 'height_... |
import itertools
# from rlbot.utils.game_state_util import CarState, BallState, GameState, Physics, Vector3
from rlbot.utils.structures.quick_chats import QuickChats
import virxrlcu
from util.agent import Vector, VirxERLU, math
from util.routines import (ball_recovery, boost_down, corner_kickoff, corner_kickoff_boost... | [
"util.utils.send_comm",
"itertools.chain",
"util.routines.retreat",
"util.utils.almost_equals",
"util.routines.corner_kickoff_boost",
"util.utils.peek_generator",
"util.utils.side",
"virxrlcu.parse_slice_for_shot",
"util.utils.sign",
"util.utils.get_weight",
"util.routines.corner_kickoff",
"ut... | [((14496, 14590), 'util.agent.Vector', 'Vector', (['enemy_intercept_location.x', 'enemy_intercept_location.y', 'enemy_intercept_location.z'], {}), '(enemy_intercept_location.x, enemy_intercept_location.y,\n enemy_intercept_location.z)\n', (14502, 14590), False, 'from util.agent import Vector, VirxERLU, math\n'), ((1... |
from unittest.mock import patch
from m2core.utils.session_helper import SessionHelper
from m2core.utils.data_helper import DataHelper
from m2core import M2Core
from contextlib import ContextDecorator
from tornado import httpclient
from tornado.escape import json_decode
from tornado.httputil import HTTPHeaders
from torn... | [
"json.dumps",
"m2core.utils.data_helper.DataHelper.random_hex_str",
"tornado.httpclient.HTTPClient",
"tornado.httpclient.HTTPRequest",
"logging.info",
"tornado.httputil.HTTPHeaders"
] | [((772, 816), 'logging.info', 'logging.info', (["('== ' + test_name + ' passed!')"], {}), "('== ' + test_name + ' passed!')\n", (784, 816), False, 'import logging\n'), ((1973, 1996), 'tornado.httpclient.HTTPClient', 'httpclient.HTTPClient', ([], {}), '()\n', (1994, 1996), False, 'from tornado import httpclient\n'), ((7... |
# 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 ap... | [
"math.sqrt",
"math.log"
] | [((8596, 8618), 'math.sqrt', 'math.sqrt', (['(2 * math.pi)'], {}), '(2 * math.pi)\n', (8605, 8618), False, 'import math\n'), ((7397, 7418), 'math.log', 'math.log', (['(2 * math.pi)'], {}), '(2 * math.pi)\n', (7405, 7418), False, 'import math\n'), ((8040, 8064), 'math.sqrt', 'math.sqrt', (['(2.0 * math.pi)'], {}), '(2.0... |
'''
Creates the plot of the predicted amount of waste for different mutation
rates and different numbers of active genes. To make the plot use:
python wasteplot.py
The graph will be saved to Probability.eps
NOTE: You CANNOT use pypy for this as pylab is current unsupported. Use
python 2.7 instead.
'''
from pylab i... | [
"pylab.xlabel",
"pylab.ylabel",
"pylab.legend",
"pylab.show",
"pylab.savefig"
] | [((699, 740), 'pylab.legend', 'legend', ([], {'loc': '"""best"""', 'title': '"""Mutation Rate"""'}), "(loc='best', title='Mutation Rate')\n", (705, 740), False, 'from pylab import plot, show, legend, savefig, xlabel, ylabel\n'), ((745, 777), 'pylab.xlabel', 'xlabel', (['"""Number of Active Genes"""'], {}), "('Number of... |
import pytest
import logging
from pytest_testconfig import config as pyconfig
import poseidon.base.CommonBase as cb
def pytest_cmdline_preparse(config, args):
# 如果能从命令行获取传入env和frequency参数
# 就将其替换pytest.ini extra section中的值
pyconfig["sections"] = config.inicfg.config.sections
_section_extra = pyconfi... | [
"pytest.fixture",
"selenium.webdriver.Chrome",
"selenium.webdriver.ChromeOptions",
"pytest.mark.skip",
"pytest_testconfig.config.get",
"selenium.webdriver.Remote",
"poseidon.base.CommonBase.get_log_path_forPytest",
"poseidon.ui.mobile.android.init_driver.get_desired_caps"
] | [((3915, 3944), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""class"""'}), "(scope='class')\n", (3929, 3944), False, 'import pytest\n'), ((4312, 4344), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (4326, 4344), False, 'import pytest\n'), ((2444, 2471), 'poseido... |
from cantools.util import batch, log
from .edit import *
from ..shared import ct_key
def _init_entity(instance, session=session, preserve_timestamps=False):
from .lookup import inc_counter, dec_counter
puts = []
now = datetime.now()
cls = instance.__class__
tname = instance.__tablename__
if tna... | [
"cantools.util.batch"
] | [((2146, 2204), 'cantools.util.batch', 'batch', (['instances', 'init_multi', 'session', 'preserve_timestamps'], {}), '(instances, init_multi, session, preserve_timestamps)\n', (2151, 2204), False, 'from cantools.util import batch, log\n')] |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 28 23:02:46 2020
@author: <NAME> & <NAME>
"""
import torch as torch
import torch.nn as nn
class LSTM(nn.Module):
"""Implémentation d'un LSTM seq-to-seq."""
def __init__(self, input_window, output_window):
"""
Init.
Parameters
-... | [
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.ReLU",
"torch.nn.LSTM",
"torch.cat"
] | [((827, 897), 'torch.nn.LSTM', 'nn.LSTM', ([], {'input_size': '(1)', 'hidden_size': '(200)', 'num_layers': '(1)', 'batch_first': '(True)'}), '(input_size=1, hidden_size=200, num_layers=1, batch_first=True)\n', (834, 897), True, 'import torch.nn as nn\n'), ((922, 937), 'torch.nn.Dropout', 'nn.Dropout', (['(0.1)'], {}), ... |
import pytest
from UnleashClient.strategies import GradualRolloutRandom
@pytest.fixture()
def strategy():
yield GradualRolloutRandom(parameters={"percentage": 50})
def test_userwithid(strategy):
assert isinstance(strategy.execute(), bool)
| [
"UnleashClient.strategies.GradualRolloutRandom",
"pytest.fixture"
] | [((75, 91), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (89, 91), False, 'import pytest\n'), ((118, 169), 'UnleashClient.strategies.GradualRolloutRandom', 'GradualRolloutRandom', ([], {'parameters': "{'percentage': 50}"}), "(parameters={'percentage': 50})\n", (138, 169), False, 'from UnleashClient.strategies ... |
import logging
import os.path
import boto3
from botocore.client import Config
from django.http import HttpResponseRedirect
from django.utils.functional import cached_property
from zentral.contrib.monolith.exceptions import RepositoryError
from zentral.utils.boto3 import make_refreshable_assume_role_session
from .base i... | [
"logging.getLogger",
"django.http.HttpResponseRedirect",
"zentral.utils.boto3.make_refreshable_assume_role_session",
"boto3.Session",
"botocore.client.Config"
] | [((352, 420), 'logging.getLogger', 'logging.getLogger', (['"""zentral.contrib.monolith.repository_backends.s3"""'], {}), "('zentral.contrib.monolith.repository_backends.s3')\n", (369, 420), False, 'import logging\n'), ((1790, 1823), 'boto3.Session', 'boto3.Session', ([], {}), '(**self.credentials)\n', (1803, 1823), Fal... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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... | [
"itertools.compress",
"code.main.main",
"os.getcwd",
"code.common.system_list.KnownSystems.get_all_systems"
] | [((651, 662), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (660, 662), False, 'import os\n'), ((1120, 1150), 'code.common.system_list.KnownSystems.get_all_systems', 'KnownSystems.get_all_systems', ([], {}), '()\n', (1148, 1150), False, 'from code.common.system_list import KnownSystems\n'), ((2304, 2330), 'code.main.main... |
import numpy as np
import torch
from model.node_model import MultimodalGenerativeCVAE
from model.model_utils import ModeKeys, exp_anneal
from stg_node import STGNode, convert_to_label_node, convert_from_label_node
from utils import plot_utils
# How to handle removal of edges:
# Cosine weight the previous output to 0.0... | [
"stg_node.convert_to_label_node",
"torch.from_numpy",
"torch.randn_like",
"torch.stack",
"torch.randint",
"model.node_model.MultimodalGenerativeCVAE",
"numpy.any",
"stg_node.convert_from_label_node"
] | [((3340, 3381), 'numpy.any', 'np.any', (["(inputs['traj_lengths'] < mhl + ph)"], {}), "(inputs['traj_lengths'] < mhl + ph)\n", (3346, 3381), True, 'import numpy as np\n'), ((5269, 5310), 'numpy.any', 'np.any', (["(inputs['traj_lengths'] < mhl + ph)"], {}), "(inputs['traj_lengths'] < mhl + ph)\n", (5275, 5310), True, 'i... |
#################################################################################
# SiEPIC Tools - utils #
#################################################################################
'''
List of functions:
advance_iterator
get_library_names
get_technology... | [
"os.walk",
"pya.ObjectInstPath",
"imp.reload",
"pya.Path",
"pya.Point",
"pya.Application.instance",
"math.log10",
"collections.defaultdict",
"xml.etree.cElementTree.XML",
"os.path.join",
"math.acos",
"pya.Library.library_by_name",
"fnmatch.filter",
"pya.LayerInfo",
"math.atan2",
"SiEPI... | [((1865, 1892), 'pya.Library.library_names', 'pya.Library.library_names', ([], {}), '()\n', (1890, 1892), False, 'import pya\n'), ((4018, 4041), 'os.path.split', 'os.path.split', (['lyp_file'], {}), '(lyp_file)\n', (4031, 4041), False, 'import os\n'), ((4182, 4217), 'os.listdir', 'os.listdir', (["technology['base_path'... |
from pygame import mixer
mixer.init()
mixer.music.load('exercicios021.mp3')
mixer.music.play()
q = int(input("foi trollado(a)? (se sim digite {1} se não digite {0}"))
if q == 1:
mixer.music.pause()
f = str(input('deseja continuar?'))
if f == str('sim'):
mixer.music.play() | [
"pygame.mixer.music.pause",
"pygame.mixer.music.load",
"pygame.mixer.music.play",
"pygame.mixer.init"
] | [((25, 37), 'pygame.mixer.init', 'mixer.init', ([], {}), '()\n', (35, 37), False, 'from pygame import mixer\n'), ((38, 75), 'pygame.mixer.music.load', 'mixer.music.load', (['"""exercicios021.mp3"""'], {}), "('exercicios021.mp3')\n", (54, 75), False, 'from pygame import mixer\n'), ((76, 94), 'pygame.mixer.music.play', '... |
import math
from collections import namedtuple
from typing import List
import requests
import wget
from bs4 import BeautifulSoup
# Book = namedtuple("Book", "Author Series Title Language File Number")
class Book:
def __init__(self, author, series, title, language, file, number, links):
self.author = aut... | [
"math.ceil",
"wget.download",
"requests.get",
"bs4.BeautifulSoup"
] | [((830, 892), 'requests.get', 'requests.get', (['"""http://gen.lib.rus.ec/fiction/?"""'], {'params': 'params'}), "('http://gen.lib.rus.ec/fiction/?', params=params)\n", (842, 892), False, 'import requests\n'), ((905, 941), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.pars... |
#!/usr/bin/python
"""
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test compare_to_expectations.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1. e... | [
"os.path.join",
"base_unittest.main"
] | [((1648, 1693), 'base_unittest.main', 'base_unittest.main', (['CompareToExpectationsTest'], {}), '(CompareToExpectationsTest)\n', (1666, 1693), False, 'import base_unittest\n'), ((1467, 1515), 'os.path.join', 'os.path.join', (['self._output_dir_actual', '"""gm.json"""'], {}), "(self._output_dir_actual, 'gm.json')\n", (... |
# Copyright 2014 Red Hat, 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 a... | [
"mock.patch.object",
"jacket.objects.compute.Instance",
"jacket.tests.compute.unit.api.openstack.fakes.HTTPRequest.blank",
"jacket.compute.exception.InstanceNotFound",
"mock.patch"
] | [((1950, 2027), 'mock.patch', 'mock.patch', (['"""compute.compute.instance.Instance.get_by_uuid"""', 'fake_get_by_uuid'], {}), "('compute.compute.instance.Instance.get_by_uuid', fake_get_by_uuid)\n", (1960, 2027), False, 'import mock\n'), ((6717, 6794), 'mock.patch', 'mock.patch', (['"""compute.compute.instance.Instanc... |
import numpy as np
import scipy.ndimage as snd
from scipy.optimize import curve_fit
from scipy import asarray
import matplotlib.pyplot as plt
import fit_gaussian as fg
from time import time
def fliplr(image):
"""Flip over vertical axis"""
return np.fliplr(image)
def flipud(image):
"""Flip over horizontal ... | [
"fit_gaussian.get_guess",
"numpy.fliplr",
"fit_gaussian.get_fit",
"numpy.flipud",
"numpy.sum",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"numpy.exp",
"fit_gaussian.process_data",
"matplotlib.pyplot.plot"
] | [((255, 271), 'numpy.fliplr', 'np.fliplr', (['image'], {}), '(image)\n', (264, 271), True, 'import numpy as np\n'), ((339, 355), 'numpy.flipud', 'np.flipud', (['image'], {}), '(image)\n', (348, 355), True, 'import numpy as np\n'), ((906, 927), 'numpy.sum', 'np.sum', (['image'], {'axis': '(0)'}), '(image, axis=0)\n', (9... |
import pytest
import yeahml as yml
from util import return_data_and_ids
available_components = return_data_and_ids("metrics")
def test_return_available_metrics():
"""test the return type and existence of available metric"""
o = yml.build.components.metric.return_available_metrics()
keys = list(o.keys())... | [
"yeahml.build.components.metric.return_available_metrics",
"pytest.mark.parametrize",
"util.return_data_and_ids"
] | [((97, 127), 'util.return_data_and_ids', 'return_data_and_ids', (['"""metrics"""'], {}), "('metrics')\n", (116, 127), False, 'from util import return_data_and_ids\n'), ((558, 644), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""metric"""', 'available_components'], {'ids': 'available_components'}), "('metri... |
"""Bay Bridge toll example."""
import os
import urllib.request
from flow.core.params import SumoParams, EnvParams, NetParams, InitialConfig, \
SumoLaneChangeParams, SumoCarFollowingParams, InFlows
from flow.core.params import VehicleParams
from flow.core.experiment import Experiment
from flow.envs.bay_bridge.bas... | [
"os.path.abspath",
"flow.core.experiment.Experiment",
"flow.core.params.NetParams",
"flow.envs.bay_bridge.base.BayBridgeEnv",
"flow.scenarios.bay_bridge_toll.BayBridgeTollScenario",
"flow.core.params.SumoCarFollowingParams",
"flow.core.params.EnvParams",
"flow.core.params.VehicleParams",
"flow.scena... | [((1186, 1231), 'flow.core.params.SumoParams', 'SumoParams', ([], {'sim_step': '(0.4)', 'overtake_right': '(True)'}), '(sim_step=0.4, overtake_right=True)\n', (1196, 1231), False, 'from flow.core.params import SumoParams, EnvParams, NetParams, InitialConfig, SumoLaneChangeParams, SumoCarFollowingParams, InFlows\n'), ((... |
import describe as describe
import data as my_data
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.colors as colors
def filter_by_key(sample, heystack, needle, data):
sub_set = dict.fromkeys(sample)
sub_set_cpy = sub_set.copy()
list_index = 0
x = 0
all_keys = []
for key i... | [
"matplotlib.pyplot.show",
"data.data",
"describe.open_file",
"matplotlib.pyplot.subplots",
"describe.not_nuermical"
] | [((5290, 5314), 'describe.open_file', 'describe.open_file', (['None'], {}), '(None)\n', (5308, 5314), True, 'import describe as describe\n'), ((5353, 5401), 'describe.open_file', 'describe.open_file', (['"""/datasets/dataset_test.csv"""'], {}), "('/datasets/dataset_test.csv')\n", (5371, 5401), True, 'import describe as... |
"""
Posterior Predictive Check Plot
===============================
_thumb: .6, .5
"""
import arviz as az
data = az.load_arviz_data("non_centered_eight")
ax = az.plot_ppc(data, alpha=0.03, figsize=(12, 6), backend="bokeh", show=True)
| [
"arviz.plot_ppc",
"arviz.load_arviz_data"
] | [((115, 155), 'arviz.load_arviz_data', 'az.load_arviz_data', (['"""non_centered_eight"""'], {}), "('non_centered_eight')\n", (133, 155), True, 'import arviz as az\n'), ((161, 235), 'arviz.plot_ppc', 'az.plot_ppc', (['data'], {'alpha': '(0.03)', 'figsize': '(12, 6)', 'backend': '"""bokeh"""', 'show': '(True)'}), "(data,... |
import pandas as pd
import pathlib
from datetime import datetime
import itertools
import json
import hashlib
import os
import pathlib
from os.path import join
import shutil
import time
import json
import numpy as np
from glob import glob
HASH_LEN = 15
# HASH_LEN = -1
RESULTS_PATH = '/work/awilf/MTAG/results/'
OVERWRIT... | [
"os.path.join",
"json.dump",
"itertools.product",
"numpy.array",
"hp.hp.keys",
"datetime.datetime.now",
"json.JSONEncoder.default",
"json.load",
"pathlib.Path",
"os.popen",
"os.path.exists",
"json.dumps",
"shutil.rmtree",
"hp.hp.items",
"pandas.DataFrame",
"os.path.isdir",
"time.slee... | [((2794, 2818), 'os.path.join', 'join', (['RESULTS_PATH', 'hash'], {}), '(RESULTS_PATH, hash)\n', (2798, 2818), False, 'from os.path import join\n'), ((2823, 2847), 'os.path.isdir', 'os.path.isdir', (['hash_path'], {}), '(hash_path)\n', (2836, 2847), False, 'import os\n'), ((3096, 3135), 'os.path.join', 'join', (['RESU... |
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import paddle.optimizer as optim
import os
class ConvInputModel(nn.Layer):
def __init__(self):
super(ConvInputModel, self).__init__()
self.conv1 = nn.Conv2D(3, 24, 3, stride=2, padding=1)
self.batchNorm... | [
"paddle.tile",
"paddle.unsqueeze",
"paddle.empty",
"paddle.nn.Conv2D",
"paddle.concat",
"paddle.reshape",
"paddle.nn.functional.log_softmax",
"paddle.argmax",
"numpy.zeros",
"paddle.nn.BatchNorm2D",
"paddle.equal",
"paddle.nn.loss.NLLLoss",
"paddle.nn.functional.relu",
"paddle.to_tensor",
... | [((257, 297), 'paddle.nn.Conv2D', 'nn.Conv2D', (['(3)', '(24)', '(3)'], {'stride': '(2)', 'padding': '(1)'}), '(3, 24, 3, stride=2, padding=1)\n', (266, 297), True, 'import paddle.nn as nn\n'), ((324, 369), 'paddle.nn.BatchNorm2D', 'nn.BatchNorm2D', ([], {'num_features': '(24)', 'momentum': '(0.1)'}), '(num_features=24... |
# this is a transcription of: https://www.youtube.com/watch?v=7FeH_yOLosU
from musicript import Musicript, Instrument, Track, bpm, track_worker
from musicript.articulations import MultiplicativeArticulation
from musicript.temperaments import EqualTemperament12
from musicript.timbres import SawtoothWave, SquareWave
fro... | [
"musicript.articulations.MultiplicativeArticulation",
"musicript.volumemodifiers.ExponentialDiminishingVolumeModifier",
"musicript.temperaments.EqualTemperament12",
"musicript.bpm",
"musicript.timbres.SawtoothWave",
"musicript.timbres.SquareWave",
"musicript.track_worker",
"musicript.Musicript"
] | [((395, 409), 'musicript.track_worker', 'track_worker', ([], {}), '()\n', (407, 409), False, 'from musicript import Musicript, Instrument, Track, bpm, track_worker\n'), ((550, 564), 'musicript.track_worker', 'track_worker', ([], {}), '()\n', (562, 564), False, 'from musicript import Musicript, Instrument, Track, bpm, t... |
import datetime
import logging
from eventstudy.eventstudy import *
from eventstudy.ibdatareader import IBDataReader
from examples.airline_crashes.ac_event_matrix import AirlineCrashEventMatrix
def main():
# Logging
logging.basicConfig(
#level=logging.INFO,
level=logging.DEBUG,
format=... | [
"eventstudy.ibdatareader.IBDataReader",
"logging.getLogger",
"datetime.datetime",
"examples.airline_crashes.ac_event_matrix.AirlineCrashEventMatrix",
"logging.StreamHandler",
"logging.FileHandler"
] | [((484, 503), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (501, 503), False, 'import logging\n'), ((860, 889), 'datetime.datetime', 'datetime.datetime', (['(2001)', '(1)', '(1)'], {}), '(2001, 1, 1)\n', (877, 889), False, 'import datetime\n'), ((905, 936), 'datetime.datetime', 'datetime.datetime', (['(2... |
## FavoriteCivicDetector
##
## Keeps track of changing Diplomacy modifiers to guess what an
## AI's favorite civic is. The intended use is for the Foreign Advisor
## to figure out and then display the correct favorite civic of an
## AI leader when playing with the Random Personalities option.
##
## Copyright (c)... | [
"AttitudeUtil.Attitude",
"SdToolKit.sdSetGlobal",
"BugUtil.debug",
"PlayerUtil.isGivingFavoriteCivicDenial",
"SdToolKit.sdGetGlobal"
] | [((2013, 2068), 'BugUtil.debug', 'BugUtil.debug', (['"""FavoriteCivicDetector.doUpdate() START"""'], {}), "('FavoriteCivicDetector.doUpdate() START')\n", (2026, 2068), False, 'import BugUtil\n'), ((6652, 6737), 'BugUtil.debug', 'BugUtil.debug', (['"""FavoriteCivicDetector.initData() initializing gFavoriteByPlayer"""'],... |
import pytest
from spacy.language import Language
from camphr.pipelines.transformers.auto import get_trf_name
from camphr.pipelines.transformers.maskedlm import (
PIPES,
add_maskedlm_pipe,
remove_maskedlm_pipe,
)
from camphr.torch_utils import get_loss_from_docs
@pytest.fixture(scope="module")
def nlp(de... | [
"camphr.torch_utils.get_loss_from_docs",
"pytest.fixture",
"pytest.skip",
"camphr.pipelines.transformers.maskedlm.add_maskedlm_pipe",
"camphr.pipelines.transformers.maskedlm.remove_maskedlm_pipe",
"pytest.mark.parametrize",
"camphr.pipelines.transformers.auto.get_trf_name"
] | [((279, 309), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (293, 309), False, 'import pytest\n'), ((662, 700), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""text"""', 'TEXTS'], {}), "('text', TEXTS)\n", (685, 700), False, 'import pytest\n'), ((523, 546), 'camp... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\components\stored_object_info_tuning.py
# Compiled at: 2018-07-13 01:10:46
# Size of source ... | [
"services.object_manager",
"sims4.tuning.tunable.TunableEnumEntry",
"services.inventory_manager"
] | [((791, 993), 'sims4.tuning.tunable.TunableEnumEntry', 'TunableEnumEntry', ([], {'description': '"""\n The participant from which the stored object is returned.\n """', 'tunable_type': 'ParticipantTypeSingle', 'default': 'ParticipantTypeSingle.Actor'}), '(description=\n """\n The par... |
# -*- coding:utf-8 -*-
import re
import html
from bs4 import BeautifulSoup
from markdown import markdown
from beem import Steem
from beem.comment import Comment
from beem.exceptions import ContentDoesNotExistsException
from steem.settings import STEEM_HOST
from utils.logging.logger import logger
REGEX_IMAGE_URL =... | [
"re.match",
"re.findall",
"markdown.markdown",
"re.sub",
"html.unescape",
"bs4.BeautifulSoup"
] | [((2240, 2277), 're.sub', 're.sub', (['"""<pre>(.*?)</pre>"""', '""" """', 'html'], {}), "('<pre>(.*?)</pre>', ' ', html)\n", (2246, 2277), False, 'import re\n'), ((2294, 2334), 're.sub', 're.sub', (['"""<code>(.*?)</code >"""', '""" """', 'html'], {}), "('<code>(.*?)</code >', ' ', html)\n", (2300, 2334), False, 'impo... |
# copyright 2018 <NAME>
# Licensed under the PSF license V2
"""
Monkeypatches to override default behavior of lib2to3.
"""
import logging
import os
import tempfile
from pathlib import Path
from appdirs import user_cache_dir
from .pgen2 import driver, grammar, pgen
__version__ = "19.3"
__base_version__ = "3.8.0a2+"... | [
"logging.getLogger",
"os.path.dirname",
"appdirs.user_cache_dir",
"pathlib.Path",
"os.rename",
"os.path.basename"
] | [((385, 430), 'appdirs.user_cache_dir', 'user_cache_dir', (['"""fissix"""'], {'version': '__version__'}), "('fissix', version=__version__)\n", (399, 430), False, 'from appdirs import user_cache_dir\n'), ((476, 484), 'pathlib.Path', 'Path', (['gt'], {}), '(gt)\n', (480, 484), False, 'from pathlib import Path\n'), ((818,... |
import sys
sys.path.append('..')
import base64
import os
import cv2
from functools import lru_cache
from tf_pose import common
from tf_pose import eval
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
Estimator = TfPoseEstimator
@lru_cache(maxsize=1)
def get_estima... | [
"functools.lru_cache",
"tf_pose.estimator.TfPoseEstimator.draw_humans",
"cv2.imshow",
"cv2.waitKey",
"tf_pose.eval.write_normkps",
"cv2.VideoCapture",
"tf_pose.networks.model_wh",
"tf_pose.common.read_imgfile",
"sys.path.append",
"tf_pose.networks.get_graph_path"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((285, 305), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': '(1)'}), '(maxsize=1)\n', (294, 305), False, 'from functools import lru_cache\n'), ((363, 379), 'tf_pose.networks.model_wh', 'model_wh', (... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
from common.tf_layer_test_class import CommonTFLayerTest
from common.utils.tf_utils import permute_nchw_to_nhwc
class TestAdd(CommonTFLayerTest):
def create_add_placeholder_const_net(self, x_shape,... | [
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.compat.v1.global_variables_initializer",
"common.utils.tf_utils.permute_nchw_to_nhwc",
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.Session",
"tensorflow.constant",
"pytest.mark.parametrize",
"tensorflow.add",
"numpy.random.randint... | [((2137, 2184), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params"""', 'test_data_1D'], {}), "('params', test_data_1D)\n", (2160, 2184), False, 'import pytest\n'), ((2906, 2953), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""params"""', 'test_data_2D'], {}), "('params', test_data_2D)\n", ... |
import requests
from bs4 import BeautifulSoup
import pandas as pd
import threading
import logging.config
import logging
from scraper.constants import REQUEST_HEADER, REQUEST_COOKIES, REQUEST_DELAY
from scraper.domains import get_website_function, get_website_name
from scraper import Filemanager
import time
class Scra... | [
"scraper.domains.get_website_name",
"logging.getLogger",
"requests.get",
"logging.config.fileConfig",
"scraper.domains.get_website_function",
"pandas.read_csv",
"threading.Thread",
"time.sleep",
"bs4.BeautifulSoup"
] | [((1297, 1389), 'pandas.read_csv', 'pd.read_csv', (['f"""{Filemanager.root_path}/scraper/products_on_hold.csv"""'], {'sep': '""","""', 'header': '(0)'}), "(f'{Filemanager.root_path}/scraper/products_on_hold.csv', sep=\n ',', header=0)\n", (1308, 1389), True, 'import pandas as pd\n'), ((1769, 1931), 'logging.config.f... |
"""Examples using TaskRule"""
import random
from time import sleep
from remake import Remake, TaskRule
from remake.formatter import remake_dict_expand as dict_exp
ex2 = Remake()
VAR_MATRIX = {'i': range(4),
'j': range(4)}
class Init(TaskRule):
rule_inputs = {}
rule_outputs = {'out': 'data/ou... | [
"remake.Remake",
"random.randint",
"remake.formatter.remake_dict_expand"
] | [((172, 180), 'remake.Remake', 'Remake', ([], {}), '()\n', (178, 180), False, 'from remake import Remake, TaskRule\n'), ((1370, 1419), 'remake.formatter.remake_dict_expand', 'dict_exp', (['Process.rule_outputs'], {'j': "VAR_MATRIX['j']"}), "(Process.rule_outputs, j=VAR_MATRIX['j'])\n", (1378, 1419), True, 'from remake.... |
#!/usr/bin/env python3
import argparse, pdfkit, re
from requests_html import HTMLSession
parser = argparse.ArgumentParser(description='Program for scraping SRE books to PDFs\n Example: \n ./main.py -u https://sre.google/sre-book/table-of-contents/')
parser.add_argument('--url','-u',help='Provide url to page to scape'... | [
"argparse.ArgumentParser",
"requests_html.HTMLSession",
"pdfkit.from_url"
] | [((100, 263), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Program for scraping SRE books to PDFs\n Example: \n ./main.py -u https://sre.google/sre-book/table-of-contents/"""'}), '(description=\n """Program for scraping SRE books to PDFs\n Example: \n ./main.py -u https://sre.google... |
import pytest
import random
from plenum.common.util import randomString
from plenum.common.ledger_uncommitted_tracker import LedgerUncommittedTracker
from common.exceptions import PlenumValueError, LogicError
@pytest.fixture()
def state_root():
return randomString(32).encode()
@pytest.fixture()
def init_commit... | [
"pytest.fixture",
"pytest.raises",
"plenum.common.util.randomString",
"random.randint",
"plenum.common.ledger_uncommitted_tracker.LedgerUncommittedTracker"
] | [((213, 229), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (227, 229), False, 'import pytest\n'), ((288, 304), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (302, 304), False, 'import pytest\n'), ((376, 392), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (390, 392), False, 'import pytest\n'), (... |
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
process = cms.Process("MCvertices")
#prepare options
options = VarParsing.VarParsing()
options.register ('globalTag',
"DONOTEXIST",
VarParsing.VarParsing.multiplicity.singleton, # singlet... | [
"FWCore.ParameterSet.Config.Process",
"FWCore.ParameterSet.Config.bool",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.InputTag",
"FWCore.ParameterSet.Config.untracked.string",
"Configuration.AlCa.GlobalTag.GlobalTag",
"FWCore.ParameterSet.Config.untracked.double",
"FWCore.... | [((104, 129), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""MCvertices"""'], {}), "('MCvertices')\n", (115, 129), True, 'import FWCore.ParameterSet.Config as cms\n'), ((159, 182), 'FWCore.ParameterSet.VarParsing.VarParsing', 'VarParsing.VarParsing', ([], {}), '()\n', (180, 182), True, 'import FWCore.Parame... |
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = "0.1"
__license__ = "MIT"
import json
from os import path
from webbrowser import open as show_file
from argh import arg
from pandas import to_datetime
from .data_processing import (data_validation, data_avail... | [
"os.path.basename",
"webbrowser.open",
"pandas.to_datetime",
"argh.arg"
] | [((1010, 1108), 'argh.arg', 'arg', (['"""--identifier"""', '"""-id"""'], {'help': '"""the id number for the station from the ehyd.gv.at platform"""'}), "('--identifier', '-id', help=\n 'the id number for the station from the ehyd.gv.at platform')\n", (1013, 1108), False, 'from argh import arg\n'), ((1105, 1193), 'ar... |
import json
import sys
import os
import requests
from requests import adapters
from urlparse import urljoin, urlparse
from testconfig import config
from tests.utils.check_server_host import check_nodes_status
class HttpRequests(object):
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureReq... | [
"urlparse.urljoin",
"urlparse.urlparse",
"requests.get",
"json.loads",
"json.dumps",
"tests.utils.check_server_host.check_nodes_status",
"sys.stderr.write",
"urllib3.disable_warnings",
"os.environ.keys",
"requests.session",
"requests.adapters.HTTPAdapter",
"os.environ.get"
] | [((265, 332), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (289, 332), False, 'import urllib3\n'), ((5825, 5893), 'requests.get', 'requests.get', (['"""/api/action/"""'], {'data': "{'composite_ids': xs, 'lim... |
import json
import os
import requests
from kaos_cli.constants import BACKEND, PACHYDERM, NOTEBOOK_CACHE
from kaos_cli.exceptions.exceptions import NoNotebookError, RequestError
from kaos_cli.utils.helpers import build_dir
from kaos_cli.utils.validators import invalidate_cache, validate_cache, validate_index
from kaos_... | [
"os.path.join",
"kaos_cli.exceptions.exceptions.RequestError",
"json.dump",
"kaos_model.api.Response.from_dict",
"requests.get",
"requests.delete",
"kaos_cli.utils.validators.validate_cache",
"kaos_cli.utils.validators.invalidate_cache",
"kaos_cli.exceptions.exceptions.NoNotebookError",
"kaos_cli.... | [((847, 890), 'requests.get', 'requests.get', (['f"""{base_url}/notebook/{name}"""'], {}), "(f'{base_url}/notebook/{name}')\n", (859, 890), False, 'import requests\n'), ((2000, 2059), 'requests.post', 'requests.post', (['f"""{base_url}/notebook/{name}"""'], {'params': 'kwargs'}), "(f'{base_url}/notebook/{name}', params... |
from django.contrib.auth import get_permission_codename
from django.contrib.auth.models import Group
from guardian.shortcuts import (
get_perms_for_model, assign_perm, remove_perm,
get_objects_for_user as guardian_objects_for_user,
get_groups_with_perms
)
from .custom_permissions import fk_queryset_filter... | [
"django.contrib.auth.models.Group.objects.get_or_create",
"guardian.shortcuts.remove_perm",
"guardian.shortcuts.get_perms_for_model",
"guardian.shortcuts.get_objects_for_user",
"guardian.shortcuts.assign_perm",
"guardian.shortcuts.get_groups_with_perms",
"django.contrib.auth.get_permission_codename"
] | [((736, 782), 'django.contrib.auth.models.Group.objects.get_or_create', 'Group.objects.get_or_create', ([], {'name': 'profile_name'}), '(name=profile_name)\n', (763, 782), False, 'from django.contrib.auth.models import Group\n'), ((814, 840), 'guardian.shortcuts.get_groups_with_perms', 'get_groups_with_perms', (['obj']... |
"""Component to integrate the Home Assistant cloud."""
import logging
from hass_nabucasa import Cloud
import voluptuous as vol
from homeassistant.components.alexa import const as alexa_const
from homeassistant.components.google_assistant import const as ga_c
from homeassistant.const import (
CONF_MODE,
CONF_N... | [
"logging.getLogger",
"hass_nabucasa.Cloud",
"voluptuous.Url",
"voluptuous.All",
"voluptuous.In",
"voluptuous.Optional"
] | [((1263, 1290), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1280, 1290), False, 'import logging\n'), ((5666, 5689), 'hass_nabucasa.Cloud', 'Cloud', (['client'], {}), '(client, **kwargs)\n', (5671, 5689), False, 'from hass_nabucasa import Cloud\n'), ((1458, 1500), 'voluptuous.Optional'... |
#
# Copyright (C) 2021 The Delta Lake Project 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... | [
"datetime.date",
"pytest.mark.skipif",
"delta_sharing.protocol.Share",
"pandas.testing.assert_frame_equal",
"pytest.raises",
"pandas.Timestamp",
"delta_sharing.protocol.Table",
"pandas.Series",
"delta_sharing.delta_sharing.load_as_spark",
"delta_sharing.protocol.Schema",
"pandas.DataFrame",
"d... | [((895, 958), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not ENABLE_INTEGRATION)'], {'reason': 'SKIP_MESSAGE'}), '(not ENABLE_INTEGRATION, reason=SKIP_MESSAGE)\n', (913, 958), False, 'import pytest\n'), ((1331, 1394), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not ENABLE_INTEGRATION)'], {'reason': 'SKIP_MESSA... |
"""Responder.
Usage:
responder
responder --version
Options:
-h --help Show this screen.
-v --version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.
"""
import docopt
from .__version__ import __version__
def cli():... | [
"docopt.docopt"
] | [((337, 427), 'docopt.docopt', 'docopt.docopt', (['__doc__'], {'argv': 'None', 'help': '(True)', 'version': '__version__', 'options_first': '(False)'}), '(__doc__, argv=None, help=True, version=__version__,\n options_first=False)\n', (350, 427), False, 'import docopt\n')] |
from time import time
import threading
import sys
from collections import deque
try:
from resource import getrusage, RUSAGE_SELF
except ImportError:
RUSAGE_SELF = 0
def getrusage(who=0):
return [0.0, 0.0] # on non-UNIX platforms cpu_time always 0.0
p_stats = None
p_start_time = None
def profiler(f... | [
"sys.setprofile",
"collections.deque",
"random.random",
"threading.setprofile",
"time.time",
"threading.Thread.__init__",
"resource.getrusage",
"threading.currentThread"
] | [((434, 456), 'resource.getrusage', 'getrusage', (['RUSAGE_SELF'], {}), '(RUSAGE_SELF)\n', (443, 456), False, 'from resource import getrusage, RUSAGE_SELF\n'), ((666, 691), 'threading.currentThread', 'threading.currentThread', ([], {}), '()\n', (689, 691), False, 'import threading\n'), ((1390, 1396), 'time.time', 'time... |
# :coding: utf-8
# :copyright: Copyright (c) 2013 <NAME>
# :license: See LICENSE.txt.
from __future__ import absolute_import
import os
import traceback
from .base import Logger
class Traceback(Logger):
'''Support extracting traceback information automatically.'''
def prepare(self, *args, **kw):
''... | [
"traceback.format_exc"
] | [((769, 791), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (789, 791), False, 'import traceback\n')] |
import os
import re
_filename_ascii_strip_re = re.compile(r"[^A-Za-z0-9_.-]")
_kubernetes_run_name_re = re.compile("[a-z0-9]([-a-z0-9]*[a-z0-9])?")
_windows_device_files = (
"CON",
"AUX",
"COM1",
"COM2",
"COM3",
"COM4",
"LPT1",
"LPT2",
"LPT3",
"PRN",
"NUL",
)
def secure_fi... | [
"unicodedata.normalize",
"re.compile"
] | [((48, 77), 're.compile', 're.compile', (['"""[^A-Za-z0-9_.-]"""'], {}), "('[^A-Za-z0-9_.-]')\n", (58, 77), False, 'import re\n'), ((105, 148), 're.compile', 're.compile', (['"""[a-z0-9]([-a-z0-9]*[a-z0-9])?"""'], {}), "('[a-z0-9]([-a-z0-9]*[a-z0-9])?')\n", (115, 148), False, 'import re\n'), ((1401, 1428), 'unicodedata... |
from django.contrib import admin
from tickets.admin import ShopTicketInline
from .models import (
CoinifyAPICallback,
CoinifyAPIInvoice,
CoinifyAPIRequest,
EpayCallback,
EpayPayment,
Invoice,
CreditNote,
CustomOrder,
ProductCategory,
Product,
Order,
OrderProductRelation,... | [
"django.contrib.admin.register",
"django.contrib.admin.site.register"
] | [((324, 357), 'django.contrib.admin.site.register', 'admin.site.register', (['EpayCallback'], {}), '(EpayCallback)\n', (343, 357), False, 'from django.contrib import admin\n'), ((358, 390), 'django.contrib.admin.site.register', 'admin.site.register', (['EpayPayment'], {}), '(EpayPayment)\n', (377, 390), False, 'from dj... |
"""The present code is the Version 1.0 of the RCNN approach to perform MPS
in 2D for categorical variables. It has been developed by <NAME> and <NAME> in the
Geometallurygical Group at Queen's University as part of a PhD program.
The code is not free of bugs but running end-to-end.
Any comments and further improv... | [
"gc.collect",
"External_Functions_2D.CreateGraph_4ConvNets_4HL_NFeaConv_wdnhxwdnh_BN",
"External_Functions_2D.Grid",
"time.time",
"numpy.random.randint"
] | [((814, 825), 'time.time', 'time.time', ([], {}), '()\n', (823, 825), False, 'import time\n'), ((1858, 1959), 'External_Functions_2D.CreateGraph_4ConvNets_4HL_NFeaConv_wdnhxwdnh_BN', 'fns_nested.CreateGraph_4ConvNets_4HL_NFeaConv_wdnhxwdnh_BN', ([], {'HyperPar': 'HyperPar', 'LocModel': 'LocModel'}), '(HyperPar=\n Hy... |
'''
This is the module for a dropdown bar chart for counts of positives
by counts by month. The dropdown box is month
'''
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.offline as pyo
import plotly.graph_objs as go
from dash.dependencies import Inpu... | [
"dash.dependencies.Input",
"dash_core_components.Graph",
"plotly.graph_objs.Bar",
"pandas.read_csv",
"plotly.graph_objs.Layout",
"dash.Dash",
"dash.dependencies.Output"
] | [((337, 348), 'dash.Dash', 'dash.Dash', ([], {}), '()\n', (346, 348), False, 'import dash\n'), ((373, 426), 'pandas.read_csv', 'pd.read_csv', (['"""/data/features_by_month_and_county.csv"""'], {}), "('/data/features_by_month_and_county.csv')\n", (384, 426), True, 'import pandas as pd\n'), ((1096, 1135), 'dash.dependenc... |
import open3d as o3d
pcd = o3d.io.read_point_cloud('bunny.ply')
vis = o3d.visualization.VisualizerWithEditing()
# vis.create_window()
vis.add_geometry(pcd)
vis.run()
vis.destroy_window()
print(vis.get_picked_points()) | [
"open3d.io.read_point_cloud",
"open3d.visualization.VisualizerWithEditing"
] | [((30, 66), 'open3d.io.read_point_cloud', 'o3d.io.read_point_cloud', (['"""bunny.ply"""'], {}), "('bunny.ply')\n", (53, 66), True, 'import open3d as o3d\n'), ((74, 115), 'open3d.visualization.VisualizerWithEditing', 'o3d.visualization.VisualizerWithEditing', ([], {}), '()\n', (113, 115), True, 'import open3d as o3d\n')... |
import argparse
import tensorflow as tf
from classifier import FeeClassifier
from shutil import rmtree
parser = argparse.ArgumentParser()
parser.add_argument('--predict', default='', type=str,
help='predict something')
parser.add_argument('--train', default=False, action='store_true',
... | [
"classifier.FeeClassifier",
"argparse.ArgumentParser",
"tensorflow.app.run",
"shutil.rmtree"
] | [((114, 139), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (137, 139), False, 'import argparse\n'), ((979, 1027), 'classifier.FeeClassifier', 'FeeClassifier', (['args.batch_size', 'args.train_steps'], {}), '(args.batch_size, args.train_steps)\n', (992, 1027), False, 'from classifier import Fe... |
# pylint:disable=wildcard-import
# pylint:disable=unused-import
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import asyncio
import datetime
import logging
import sys
from pathlib import Path
from pprint import pformat
from typing import Dict
import docker
imp... | [
"pprint.pformat",
"pytest.fixture",
"logging.getLogger",
"pathlib.Path",
"yaml.safe_load",
"docker.from_env",
"asyncio.sleep"
] | [((369, 396), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (386, 396), False, 'import logging\n'), ((464, 491), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (481, 491), False, 'import logging\n'), ((604, 635), 'pytest.fixture', 'pytest.fixture', ([], {'s... |
import argparse
from munch import RecursiveMunch
import shutil
import subprocess
from tqdm import tqdm
from time import time
from pathlib import Path
import torch
from torch.nn import functional as F
from torch.utils.data import DataLoader
from lightning.novel_view_synthesis import LitNovelViewSynthesis
from utils.in... | [
"torch.device",
"data.Panoptic.transform.PanopticImagePairTransform",
"data.Human36M.transform.Human36MImagePairTransform",
"operations.pca.Features2Image",
"torch.cuda.is_available",
"argparse.ArgumentParser",
"lightning.novel_view_synthesis.LitNovelViewSynthesis.load_from_checkpoint",
"torch.utils.d... | [((525, 550), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (548, 550), False, 'import argparse\n'), ((1113, 1132), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (1125, 1132), False, 'import torch\n'), ((1140, 1165), 'torch.cuda.is_available', 'torch.cuda.is_available', ([]... |
"""
Display results in Alfred
"""
from __future__ import print_function
import json
import parser
import datastore as d
import logger
import config
import action as a
import icon as i
def display(query):
"""
Display results by parsing argument
Display tasklist if no argument given and add option if argume... | [
"logger.log",
"datastore.get_data",
"json.dumps",
"parser.generate_argument"
] | [((1009, 1057), 'parser.generate_argument', 'parser.generate_argument', (['a.COMPLETE_TASK', 'query'], {}), '(a.COMPLETE_TASK, query)\n', (1033, 1057), False, 'import parser\n'), ((1227, 1273), 'parser.generate_argument', 'parser.generate_argument', (['a.DELETE_TASK', 'query'], {}), '(a.DELETE_TASK, query)\n', (1251, 1... |
# -*- coding: utf-8 -*-
"""
Python2 code for Landscape Modeling class exercise 3
Thermal Profiles (AKA, snake writhing in an exponential funnel)
Written by <NAME> on 2/2/2018
"""
#%% import modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
degree = u"\u00b0" # unicode... | [
"numpy.exp",
"matplotlib.pyplot.gca",
"numpy.linspace",
"numpy.ndarray",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xlim",
"numpy.sqrt",
"matplotlib.pyplot.axvline",
"numpy.arange",
"numpy.sin",
"matplotlib... | [((623, 651), 'numpy.linspace', 'np.linspace', (['(0)', '(800)'], {'num': '(801)'}), '(0, 800, num=801)\n', (634, 651), True, 'import numpy as np\n'), ((708, 757), 'matplotlib.pyplot.axvline', 'plt.axvline', (['(0)', '(0)', '(800)'], {'color': '"""k"""', 'linestyle': '"""--"""'}), "(0, 0, 800, color='k', linestyle='--'... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)):
gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
if(orient=='x'):
sobel = cv2.Sobel(gray, cv2.CV_64F, 1, 0)
else:
if(orient... | [
"cv2.inRange",
"numpy.zeros_like",
"matplotlib.pyplot.subplots_adjust",
"numpy.copy",
"numpy.max",
"numpy.arctan2",
"cv2.Sobel",
"matplotlib.pyplot.show",
"numpy.sqrt",
"cv2.cvtColor",
"matplotlib.pyplot.subplots",
"cv2.add",
"matplotlib.image.imread",
"numpy.uint8",
"numpy.absolute"
] | [((181, 220), 'cv2.cvtColor', 'cv2.cvtColor', (['image', 'cv2.COLOR_RGB2GRAY'], {}), '(image, cv2.COLOR_RGB2GRAY)\n', (193, 220), False, 'import cv2\n'), ((408, 426), 'numpy.absolute', 'np.absolute', (['sobel'], {}), '(sobel)\n', (419, 426), True, 'import numpy as np\n'), ((504, 531), 'numpy.zeros_like', 'np.zeros_like... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = '<NAME>'
import os
import logging
import logging.config
import dependencies
from datetime import datetime
from flask import Flask, render_template, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
# MAIL
from flask_mail import Mail
# SECURITY
from ... | [
"flask.ext.security.login_user",
"flask.ext.security.Security",
"flask.ext.social.Social",
"os.path.exists",
"flask.ext.social.views.connect_handler",
"os.makedirs",
"flask.ext.social.login_failed.connect_via",
"dependencies.download",
"flask.Flask",
"flask_admin.Admin",
"flask_sqlalchemy.SQLAlc... | [((1185, 1200), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1190, 1200), False, 'from flask import Flask, render_template, redirect, url_for\n'), ((1242, 1251), 'flask_mail.Mail', 'Mail', (['app'], {}), '(app)\n', (1246, 1251), False, 'from flask_mail import Mail\n'), ((1258, 1273), 'flask_sqlalchemy.S... |
import torch
from torch_geometric.data import Dataset, Data, DataLoader
from tqdm import *
from torch.nn import Linear
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
from torch_geometric.nn import global_mean_pool
#load local packages
from ConuForecast.src.graph_utils import GraphManager, DBcon... | [
"torch_geometric.nn.GCNConv",
"torch.manual_seed",
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.CrossEntropyLoss",
"torch_geometric.nn.global_mean_pool"
] | [((1481, 1508), 'torch.nn.CrossEntropyLoss', 'torch.nn.CrossEntropyLoss', ([], {}), '()\n', (1506, 1508), False, 'import torch\n'), ((527, 551), 'torch.manual_seed', 'torch.manual_seed', (['(12345)'], {}), '(12345)\n', (544, 551), False, 'import torch\n'), ((573, 627), 'torch_geometric.nn.GCNConv', 'GCNConv', (['datalo... |
import logging
import os
import time
from datetime import datetime
from threading import Thread
from common_utils_py.agreements.service_agreement import ServiceTypesIndices
from common_utils_py.agreements.service_agreement_template import ServiceAgreementTemplate
from common_utils_py.agreements.service_types import Se... | [
"logging.getLogger",
"nevermined_gateway_events.agreement_store.agreements.AgreementsStorage",
"common_utils_py.did.id_to_did",
"datetime.datetime.now",
"common_utils_py.agreements.utils.get_sla_template",
"os.getenv",
"threading.Thread",
"common_utils_py.did_resolver.did_resolver.DIDResolver",
"tim... | [((773, 800), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (790, 800), False, 'import logging\n'), ((2551, 2588), 'nevermined_gateway_events.agreement_store.agreements.AgreementsStorage', 'AgreementsStorage', (['self._storage_path'], {}), '(self._storage_path)\n', (2568, 2588), False, '... |
import logging
from westtools import (WESTParallelTool, WESTDataReader, IterRangeSelection,
ProgressIndicatorComponent)
import westpa
from westpa.extloader import get_object
log = logging.getLogger('westtools.w_crawl')
class WESTPACrawler:
'''Base class for general crawling execution. Thi... | [
"westtools.ProgressIndicatorComponent",
"logging.getLogger",
"westtools.IterRangeSelection",
"westtools.WESTDataReader",
"westpa.extloader.get_object",
"westpa.rc.get_data_manager"
] | [((206, 244), 'logging.getLogger', 'logging.getLogger', (['"""westtools.w_crawl"""'], {}), "('westtools.w_crawl')\n", (223, 244), False, 'import logging\n'), ((734, 762), 'westpa.rc.get_data_manager', 'westpa.rc.get_data_manager', ([], {}), '()\n', (760, 762), False, 'import westpa\n'), ((1620, 1648), 'westtools.Progre... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
from copy import deepcopy
from lxml import etree
def merge_dicts(a, b):
ret = deepcopy(a)
for k, v in list(b.items()):
ret[k] = ' '.join(ret.get(k, '').split(' ') + v.split(' ')).strip()
return ret
clas... | [
"collections.OrderedDict",
"copy.deepcopy",
"lxml.etree.HTML"
] | [((178, 189), 'copy.deepcopy', 'deepcopy', (['a'], {}), '(a)\n', (186, 189), False, 'from copy import deepcopy\n'), ((5408, 5421), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (5419, 5421), False, 'from collections import OrderedDict\n'), ((2262, 2278), 'lxml.etree.HTML', 'etree.HTML', (['html'], {}), '(... |
"""
Code with defetc distortion functions (bdm, rattle and local_rattle)
"""
from typing import Optional
import numpy as np
from pymatgen.io.ase import AseAtomsAdaptor
from pymatgen.core.structure import Structure
from pymatgen.transformations.advanced_transformations import MonteCarloRattleTransformation
def bdm(
... | [
"pymatgen.io.ase.AseAtomsAdaptor",
"numpy.dot"
] | [((1830, 1847), 'pymatgen.io.ase.AseAtomsAdaptor', 'AseAtomsAdaptor', ([], {}), '()\n', (1845, 1847), False, 'from pymatgen.io.ase import AseAtomsAdaptor\n'), ((5624, 5641), 'pymatgen.io.ase.AseAtomsAdaptor', 'AseAtomsAdaptor', ([], {}), '()\n', (5639, 5641), False, 'from pymatgen.io.ase import AseAtomsAdaptor\n'), ((6... |
from app import db
class Localization(db.Model):
__tablename__ = "localization"
__bind_key__ = "constants"
tag = db.Column(db.String, primary_key=True)
text = db.Column(db.String, primary_key=True)
language = db.Column(db.String, primary_key=True) | [
"app.db.Column"
] | [((126, 164), 'app.db.Column', 'db.Column', (['db.String'], {'primary_key': '(True)'}), '(db.String, primary_key=True)\n', (135, 164), False, 'from app import db\n'), ((176, 214), 'app.db.Column', 'db.Column', (['db.String'], {'primary_key': '(True)'}), '(db.String, primary_key=True)\n', (185, 214), False, 'from app im... |
# MIT License
#
# Copyright (c) 2018 <NAME>, <EMAIL>
#
# 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, including without limitation the rights
# to use, copy, modify, mer... | [
"pytest.mark.parametrize",
"ethereumetl.jobs.exporters.receipts_and_logs_item_exporter.receipts_and_logs_item_exporter",
"tests.helpers.read_file"
] | [((2073, 2323), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""batch_size,tx_hashes,output_format,resource_group"""', "[(1, DEFAULT_TX_HASHES, 'csv', 'receipts_with_logs'), (2, DEFAULT_TX_HASHES,\n 'csv', 'receipts_with_logs'), (2, DEFAULT_TX_HASHES, 'json',\n 'receipts_with_logs')]"], {}), "('batch_... |
import json
import dash
import dash_bio
import dash_html_components as html
from common_features import simple_app_layout, simple_app_callback
_data = None
_COMPONENT_ID = 'test-circos'
with open(
'tests/dashbio_demos/dash-circos/data/graph_data.json', 'r'
) as f:
_data = json.loads(f.read())
def tes... | [
"dash.Dash",
"dash_bio.Circos",
"json.dumps"
] | [((363, 382), 'dash.Dash', 'dash.Dash', (['__name__'], {}), '(__name__)\n', (372, 382), False, 'import dash\n'), ((1092, 1111), 'dash.Dash', 'dash.Dash', (['__name__'], {}), '(__name__)\n', (1101, 1111), False, 'import dash\n'), ((437, 494), 'dash_bio.Circos', 'dash_bio.Circos', ([], {'id': '_COMPONENT_ID', 'layout': "... |
import logging
from alephclient.services.entityextract_pb2_grpc import EntityExtractStub
from alephclient.services.entityextract_pb2 import ExtractedEntity
from aleph import settings
from aleph.services import ServiceClientMixin
from aleph.analyze.analyzer import EntityAnalyzer, TextIterator
from aleph.model import Do... | [
"aleph.model.DocumentTagCollector",
"logging.getLogger",
"alephclient.services.entityextract_pb2_grpc.EntityExtractStub"
] | [((359, 386), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (376, 386), False, 'import logging\n'), ((1303, 1334), 'alephclient.services.entityextract_pb2_grpc.EntityExtractStub', 'EntityExtractStub', (['self.channel'], {}), '(self.channel)\n', (1320, 1334), False, 'from alephclient.serv... |
from .adaptivedataloader import AdaptiveDSSDataLoader
from cords.selectionstrategies.SL import RandomStrategy
import time, copy, logging
class OLRandomDataLoader(AdaptiveDSSDataLoader):
def __init__(self, train_loader, dss_args, logger, *args, **kwargs):
super(OLRandomDataLoader, self).__init__(train_loade... | [
"logging.debug",
"time.time",
"cords.selectionstrategies.SL.RandomStrategy"
] | [((445, 486), 'cords.selectionstrategies.SL.RandomStrategy', 'RandomStrategy', (['train_loader'], {'online': '(True)'}), '(train_loader, online=True)\n', (459, 486), False, 'from cords.selectionstrategies.SL import RandomStrategy\n'), ((606, 617), 'time.time', 'time.time', ([], {}), '()\n', (615, 617), False, 'import t... |
from django.conf import settings
from django.core import management
from django.core.management.base import BaseCommand
import subprocess
"""
https://www.postgresql.org/docs/current/app-dropdb.html
"""
class Command(BaseCommand):
help = 'drop postgres database'
def add_arguments(self, parser):
super... | [
"subprocess.check_call"
] | [((868, 895), 'subprocess.check_call', 'subprocess.check_call', (['args'], {}), '(args)\n', (889, 895), False, 'import subprocess\n')] |
"""Interface for reinforcement learning."""
from deepchem.rl.a2c import A2C # noqa: F401
from deepchem.rl.ppo import PPO # noqa: F401
class Environment(object):
"""An environment in which an actor performs actions to accomplish a task.
An environment has a current state, which is represented as either a singl... | [
"gym.make"
] | [((5135, 5149), 'gym.make', 'gym.make', (['name'], {}), '(name)\n', (5143, 5149), False, 'import gym\n')] |
"""
The pycity_scheduling framework
Copyright (C) 2022,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
RWTH Aachen University
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Softwa... | [
"pycity_scheduling.util.factory.generate_tabula_district",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid",
"pycity_scheduling.util.factory.generate_standard_environment",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"pycity_scheduling.util.debug.print_district",
"numpy.array",
"matplot... | [((2019, 2119), 'pycity_scheduling.util.factory.generate_standard_environment', 'factory.generate_standard_environment', ([], {'initial_date': '(2018, 12, 6)', 'step_size': '(900)', 'op_horizon': '(96)'}), '(initial_date=(2018, 12, 6), step_size\n =900, op_horizon=96)\n', (2056, 2119), True, 'import pycity_schedulin... |
from django.conf.urls import patterns, url
from wxgigo.admin.core import views
from contrib.admin.core import web_auth_views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'web.views.home', name='home'),
# always get the first record
url(r'^$', views.main),
... | [
"contrib.admin.core.web_auth_views.SnsBaseWebView.as_view",
"contrib.admin.core.web_auth_views.SnsUserinfoWebView.as_view",
"django.conf.urls.url"
] | [((285, 306), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.main'], {}), "('^$', views.main)\n", (288, 306), False, 'from django.conf.urls import patterns, url\n'), ((623, 708), 'django.conf.urls.url', 'url', (['"""^web/user_info/$"""', 'web_auth_views.web_user_info'], {'name': '"""core.web.user_info"""'}), "('^w... |
import unittest
from unittest.mock import Mock, call
import pluca
class CacheAdapter(pluca.CacheAdapter):
pass
CacheAdapter.__abstractmethods__ = set() # type: ignore
class TestAdapter(unittest.TestCase):
def test_has(self):
a = CacheAdapter()
a.get = Mock(return_value=True)
se... | [
"unittest.mock.Mock",
"unittest.mock.call"
] | [((286, 309), 'unittest.mock.Mock', 'Mock', ([], {'return_value': '(True)'}), '(return_value=True)\n', (290, 309), False, 'from unittest.mock import Mock, call\n'), ((499, 505), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (503, 505), False, 'from unittest.mock import Mock, call\n'), ((748, 754), 'unittest.mock.Mock... |
"""Functions shared between different beamformer types."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from copy import deepcopy
import numpy as np
from scipy import linalg
from ..cov import Covariance, make_ad_hoc_cov
from ..forward.forward import... | [
"copy.deepcopy",
"numpy.iscomplexobj",
"numpy.eye",
"numpy.sum",
"numpy.sqrt",
"numpy.finfo",
"numpy.errstate",
"numpy.zeros",
"numpy.abs",
"numpy.diag",
"numpy.ones",
"numpy.all",
"scipy.linalg.eigh",
"numpy.dot"
] | [((7163, 7188), 'numpy.dot', 'np.dot', (['max_power_ori', 'Wk'], {}), '(max_power_ori, Wk)\n', (7169, 7188), True, 'import numpy as np\n'), ((7198, 7223), 'numpy.dot', 'np.dot', (['Gk', 'max_power_ori'], {}), '(Gk, max_power_ori)\n', (7204, 7223), True, 'import numpy as np\n'), ((7284, 7298), 'numpy.sqrt', 'np.sqrt', (... |
from collections import OrderedDict
import numpy as np
from PyQt5.QtCore import QCoreApplication, pyqtSlot
from PyQt5.QtWidgets import QWidget, QComboBox, QVBoxLayout, QLabel, QFormLayout, QSizePolicy
# from pyntpg.datasets_container import DatasetsContainer
# from pyntpg.analysis.ipython_console import IPythonConsol... | [
"numpy.shape",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QFormLayout",
"collections.OrderedDict",
"PyQt5.QtCore.QCoreApplication.instance",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtCore.pyqtSlot",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QVBoxLayout"
] | [((2949, 2967), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', (['str', 'str'], {}), '(str, str)\n', (2957, 2967), False, 'from PyQt5.QtCore import QCoreApplication, pyqtSlot\n'), ((3200, 3213), 'PyQt5.QtCore.pyqtSlot', 'pyqtSlot', (['str'], {}), '(str)\n', (3208, 3213), False, 'from PyQt5.QtCore import QCoreApplication, pyqtSlo... |
import pytest
from collections import Counter
from ci_mapping.utils.utils import flatten_lists
from ci_mapping.utils.utils import unique_dicts
from ci_mapping.utils.utils import unique_dicts_by_value
from ci_mapping.utils.utils import cooccurrence_graph
from ci_mapping.utils.utils import allocate_in_group
example_lis... | [
"ci_mapping.utils.utils.flatten_lists",
"ci_mapping.utils.utils.cooccurrence_graph",
"ci_mapping.utils.utils.allocate_in_group",
"ci_mapping.utils.utils.unique_dicts",
"collections.Counter",
"ci_mapping.utils.utils.unique_dicts_by_value"
] | [((761, 787), 'ci_mapping.utils.utils.flatten_lists', 'flatten_lists', (['nested_list'], {}), '(nested_list)\n', (774, 787), False, 'from ci_mapping.utils.utils import flatten_lists\n'), ((865, 896), 'ci_mapping.utils.utils.unique_dicts', 'unique_dicts', (['example_list_dict'], {}), '(example_list_dict)\n', (877, 896),... |
import cv2
img = cv2.imread(r"..\lena.jpg")
t, rst = cv2.threshold(img, 127, 255, cv2.THRESH_TOZERO)
cv2.imshow("img", img)
cv2.imshow("rst", rst)
cv2.waitKey()
cv2.destroyAllWindows()
| [
"cv2.imshow",
"cv2.threshold",
"cv2.waitKey",
"cv2.imread",
"cv2.destroyAllWindows"
] | [((18, 44), 'cv2.imread', 'cv2.imread', (['"""..\\\\lena.jpg"""'], {}), "('..\\\\lena.jpg')\n", (28, 44), False, 'import cv2\n'), ((54, 101), 'cv2.threshold', 'cv2.threshold', (['img', '(127)', '(255)', 'cv2.THRESH_TOZERO'], {}), '(img, 127, 255, cv2.THRESH_TOZERO)\n', (67, 101), False, 'import cv2\n'), ((102, 124), 'c... |
# Generated by Django 3.2.9 on 2021-11-08 17:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='BrandColor',
fields=[
('id', ... | [
"django.db.migrations.RenameField",
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((520, 606), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""size"""', 'old_name': '"""small"""', 'new_name': '"""brandsize"""'}), "(model_name='size', old_name='small', new_name=\n 'brandsize')\n", (542, 606), False, 'from django.db import migrations, models\n'), ((320, 413), ... |
from random import randint
import random
answer_list=[]
global our_states
our_states = ['california', 'florida', 'illinois', 'kentucky','nebraska', 'nevada', 'newyork', 'oregon', 'texas']
global our_state_capitals
our_state_capitals = {
'california':"sacramento",
'florida':"tallahasse",
'illinois':"sorinfield",
'k... | [
"random.shuffle"
] | [((1675, 1702), 'random.shuffle', 'random.shuffle', (['answer_list'], {}), '(answer_list)\n', (1689, 1702), False, 'import random\n'), ((1598, 1624), 'random.shuffle', 'random.shuffle', (['our_states'], {}), '(our_states)\n', (1612, 1624), False, 'import random\n')] |
from __future__ import print_function
import copy
import six
import warnings
import functools
from paddle.fluid import layers
from paddle.fluid import framework
from paddle.fluid import core
from paddle.fluid import name_scope
from paddle.fluid.dygraph import base as imperative_base
from paddle.fluid.clip import Grad... | [
"paddle.fluid.layers.square",
"paddle.fluid.layers.concat",
"paddle.fluid.layers.reduce_sum",
"paddle.fluid.layers.get_tensor_from_selected_rows",
"paddle.fluid.layers.clip",
"paddle.fluid.layers.elementwise_max",
"paddle.fluid.layers.merge_selected_rows",
"paddle.fluid.layers.elementwise_mul",
"pad... | [((2432, 2462), 'paddle.fluid.layers.concat', 'layers.concat', (['sum_square_list'], {}), '(sum_square_list)\n', (2445, 2462), False, 'from paddle.fluid import layers\n'), ((2489, 2523), 'paddle.fluid.layers.reduce_sum', 'layers.reduce_sum', (['global_norm_var'], {}), '(global_norm_var)\n', (2506, 2523), False, 'from p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.