code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""A class that represents a report."""
from typing import cast
from shared.utils.type import Color, ReportId, Status
from .measurement import Measurement
from .subject import Subject
from .metric import Metric
STATUS_COLOR_MAPPING = cast(
dict[Status, Color],
dict(target_met="green", debt_target_met="grey... | [
"typing.cast"
] | [((1132, 1167), 'typing.cast', 'cast', (['ReportId', "self['report_uuid']"], {}), "(ReportId, self['report_uuid'])\n", (1136, 1167), False, 'from typing import cast\n')] |
import math
import numpy as np
from keras.datasets import mnist, cifar10
def combine_images(generated_images):
num = generated_images.shape[0]
width = int(math.sqrt(num))
height = int(math.ceil(float(num) / width))
shape = generated_images.shape[1:3]
image = np.zeros((height * shape[0], width * s... | [
"keras.datasets.cifar10.load_data",
"numpy.zeros",
"math.sqrt",
"keras.datasets.mnist.load_data"
] | [((282, 359), 'numpy.zeros', 'np.zeros', (['(height * shape[0], width * shape[1])'], {'dtype': 'generated_images.dtype'}), '((height * shape[0], width * shape[1]), dtype=generated_images.dtype)\n', (290, 359), True, 'import numpy as np\n'), ((729, 746), 'keras.datasets.mnist.load_data', 'mnist.load_data', ([], {}), '()... |
import click
import erhsh
from erhsh.pt.demo import demo_mgmt
def print_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
click.echo("Supported PyTorch Demo version is %s" % erhsh.pt.demo.version.__version__)
ctx.exit()
@click.group(help='This is PyTorch Demo Command Lin... | [
"click.argument",
"click.group",
"click.option",
"click.echo",
"erhsh.pt.demo.demo_mgmt.DemoMgmt"
] | [((270, 332), 'click.group', 'click.group', ([], {'help': '"""This is PyTorch Demo Command Line Console."""'}), "(help='This is PyTorch Demo Command Line Console.')\n", (281, 332), False, 'import click\n'), ((334, 466), 'click.option', 'click.option', (['"""--version"""'], {'is_flag': '(True)', 'callback': 'print_versi... |
import __future__
import torchvision.models as models
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch
import time
import os
import matplotlib.pyplot as plt
from PIL import Image
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
'''
内容损失函数
content_feature... | [
"os.path.exists",
"PIL.Image.open",
"torchvision.transforms.ToPILImage",
"torchvision.models.vgg19",
"torch.nn.Sequential",
"torch.load",
"torch.nn.MSELoss",
"torch.cuda.is_available",
"torch.nn.Parameter",
"torch.optim.LBFGS",
"os.mkdir",
"torchvision.transforms.Resize",
"torchvision.transf... | [((256, 281), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (279, 281), False, 'import torch\n'), ((695, 713), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {}), '()\n', (711, 713), False, 'import torch\n'), ((1731, 1749), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {}), '()\n', (1747, 1749), ... |
from __future__ import division
import numpy as np
from collections import namedtuple
import bilby
from bilby.gw import conversion
import os
import gwpopulation
MassContainer = namedtuple('MassContainer', ['primary_masses', 'secondary_masses',
'mass_ratios', 'total_masses... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"matplotlib.pyplot.semilogy",
"numpy.random.random",
"matplotlib.pyplot.xlabel",
"numpy.max",
"numpy.linspace",
"gwpopulation.models.mass.power_law_primary_mass_ratio",
"matplotlib.pyplot.scatter",
"numpy.meshgrid",
"collections.namedtuple",
"os.path.... | [((180, 298), 'collections.namedtuple', 'namedtuple', (['"""MassContainer"""', "['primary_masses', 'secondary_masses', 'mass_ratios', 'total_masses',\n 'chirp_masses']"], {}), "('MassContainer', ['primary_masses', 'secondary_masses',\n 'mass_ratios', 'total_masses', 'chirp_masses'])\n", (190, 298), False, 'from c... |
import pytest
import yamljinja.core
@pytest.mark.parametrize('args, kwargs', [
([], dict()),
])
def test_NullUndefined_init(args, kwargs):
assert isinstance(yamljinja.core.NullUndefined(*args, **kwargs), yamljinja.core.NullUndefined)
@pytest.mark.parametrize('null_undefined, key, expected', [
# (yamlji... | [
"pytest.mark.parametrize"
] | [((532, 711), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""args, kwargs, expected"""', '[(["""var1: val1\nvar2: val2\nvar3: \'{{var1}}-{{var2}}\'\n"""], {}, {\'var1\':\n \'val1\', \'var2\': \'val2\', \'var3\': \'val1-val2\'})]'], {}), '(\'args, kwargs, expected\', [([\n """var1: val1\nvar2: val2\nv... |
import os
import numpy as np
import time
import sys
import paddle
import paddle.fluid as fluid
from resnet import TSN_ResNet
import reader
import argparse
import functools
from paddle.fluid.framework import Parameter
from utility import add_arguments, print_arguments
parser = argparse.ArgumentParser(description=__doc... | [
"paddle.fluid.DataFeeder",
"reader.infer",
"argparse.ArgumentParser",
"paddle.fluid.default_startup_program",
"resnet.TSN_ResNet",
"paddle.fluid.layers.data",
"numpy.argsort",
"paddle.fluid.default_main_program",
"paddle.fluid.Executor",
"functools.partial",
"paddle.fluid.io.load_vars",
"paddl... | [((279, 323), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (302, 323), False, 'import argparse\n'), ((334, 384), 'functools.partial', 'functools.partial', (['add_arguments'], {'argparser': 'parser'}), '(add_arguments, argparser=parser)\n', (351, 384)... |
import sys
import types
import _dk_core as core
# def enum(*sequential, **named):
# enums = dict(zip(sequential, range(len(sequential))), **named)
# return type('Enum', (), enums)
def enum(*seq, begin=0, prefix='Enum_'):
from collections import namedtuple
t = namedtuple(prefix + core.uuidgen().replace... | [
"_dk_core.uuidgen",
"_dk_core.Rect"
] | [((5201, 5212), '_dk_core.Rect', 'core.Rect', ([], {}), '()\n', (5210, 5212), True, 'import _dk_core as core\n'), ((9748, 9759), '_dk_core.Rect', 'core.Rect', ([], {}), '()\n', (9757, 9759), True, 'import _dk_core as core\n'), ((9917, 9928), '_dk_core.Rect', 'core.Rect', ([], {}), '()\n', (9926, 9928), True, 'import _d... |
from floodsystem.station import inconsistent_typical_range_stations
from floodsystem.stationdata import build_station_list
def run():
temp=inconsistent_typical_range_stations(build_station_list())
x=[]
for i in range(len(temp)):
x.append(temp[i].name)
x.sort()
print(x)
if __name__... | [
"floodsystem.stationdata.build_station_list"
] | [((181, 201), 'floodsystem.stationdata.build_station_list', 'build_station_list', ([], {}), '()\n', (199, 201), False, 'from floodsystem.stationdata import build_station_list\n')] |
# Copyright (c) 2020, 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... | [
"megatron.mpu.get_tensor_model_parallel_world_size",
"megatron.model.language_model.parallel_lm_logits",
"deepspeed.pipe.TiedLayerSpec",
"os.getenv",
"veGiantModel.launcher.launch.launch_bps",
"torch.cuda.device_count",
"megatron.model.utils.init_method_normal",
"megatron.mpu.get_data_parallel_world_s... | [((1715, 1725), 'megatron.get_args', 'get_args', ([], {}), '()\n', (1723, 1725), False, 'from megatron import get_args, mpu\n'), ((1796, 1836), 'megatron.model.utils.init_method_normal', 'init_method_normal', (['args.init_method_std'], {}), '(args.init_method_std)\n', (1814, 1836), False, 'from megatron.model.utils imp... |
import os
import numpy as np
import torch
import torch.utils.data as data
from .common import flatten_first_dim, load_dataset, load_datasets, data_dir, dataset_bounds
from .utils import *
batch_size = 1
input_features = [
'x', 'y', 'z',
'q',
'ax', 'ay', 'az',
'rq'
]
list_datasets_lab = [
'3d/l... | [
"os.path.join",
"numpy.min",
"torch.from_numpy",
"numpy.max",
"numpy.append",
"torch.utils.data.DataLoader"
] | [((1640, 1694), 'numpy.min', 'np.min', (['(lab_min, carm_min, test_min, val_min)'], {'axis': '(0)'}), '((lab_min, carm_min, test_min, val_min), axis=0)\n', (1646, 1694), True, 'import numpy as np\n'), ((1705, 1759), 'numpy.max', 'np.max', (['(lab_max, carm_max, test_max, val_max)'], {'axis': '(0)'}), '((lab_max, carm_m... |
import types
import logging
import time
import numpy as np
from jbopt.de import de
from jbopt.classic import classical
from starkit.fitkit.priors import PriorCollection
logger = logging.getLogger(__name__)
def fit_evaluate(self, model_param):
# returns the likelihood of observing the data given the model param... | [
"logging.getLogger",
"jbopt.de.de",
"numpy.asarray",
"jbopt.classic.classical",
"types.MethodType",
"time.time"
] | [((181, 208), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (198, 208), False, 'import logging\n'), ((732, 748), 'numpy.asarray', 'np.asarray', (['cube'], {}), '(cube)\n', (742, 748), True, 'import numpy as np\n'), ((1080, 1127), 'types.MethodType', 'types.MethodType', (['fit_evaluate', ... |
#!/usr/bin/env python
""" Newton Check Boot Image
Usage:
checkBootImage.py <file_name>
Options:
-h --help Shows this help message.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from docopt import docopt
import sys
import io
import o... | [
"re.sub",
"docopt.docopt",
"sys.exit"
] | [((7464, 7494), 'docopt.docopt', 'docopt', (['__doc__'], {'version': '"""0.1"""'}), "(__doc__, version='0.1')\n", (7470, 7494), False, 'from docopt import docopt\n'), ((7552, 7563), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (7560, 7563), False, 'import sys\n'), ((722, 745), 're.sub', 're.sub', (['"""\\\\n"""', '"... |
import xbos_services_getter as xsg
import numpy as np
"""Thermostat class to model temperature change.
Note, set STANDARD fields to specify error for actions which do not have enough data for valid predictions. """
class Tstat:
STANDARD_MEAN = 0
STANDARD_VAR = 0
STANDARD_UNIT = "F"
def __init__(self, ... | [
"numpy.random.normal",
"xbos_services_getter.get_indoor_temperature_prediction_stub",
"xbos_services_getter.get_indoor_temperature_prediction_error"
] | [((549, 593), 'xbos_services_getter.get_indoor_temperature_prediction_stub', 'xsg.get_indoor_temperature_prediction_stub', ([], {}), '()\n', (591, 593), True, 'import xbos_services_getter as xsg\n'), ((2070, 2141), 'numpy.random.normal', 'np.random.normal', (["self.error[action]['mean']", "self.error[action]['var']"], ... |
from django.conf import settings
from django.db import models
# Create your models here.
from django.urls import reverse # Used to generate URLs by reversing the URL patterns
import datetime
class Post(models.Model):
title = models.CharField(max_length=200,null=False)
content = models.TextField(max_length=300... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((231, 275), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(False)'}), '(max_length=200, null=False)\n', (247, 275), False, 'from django.db import models\n'), ((289, 365), 'django.db.models.TextField', 'models.TextField', ([], {'max_length': '(3000)', 'help_text': '"""Enter a ... |
import itertools
from functools import reduce
import operator
__version__ = '0.0.1'
get0 = operator.itemgetter(0)
get1 = operator.itemgetter(1)
def lfind(xs, x):
'''
Find the index of the first (leftmost) instance of `x` in `xs` (a list).
Raises `ValueError` if `x` is not in `xs`
'''
return xs... | [
"functools.reduce",
"operator.itemgetter",
"itertools.islice",
"itertools.groupby"
] | [((94, 116), 'operator.itemgetter', 'operator.itemgetter', (['(0)'], {}), '(0)\n', (113, 116), False, 'import operator\n'), ((124, 146), 'operator.itemgetter', 'operator.itemgetter', (['(1)'], {}), '(1)\n', (143, 146), False, 'import operator\n'), ((2497, 2524), 'functools.reduce', 'reduce', (['operator.mul', 'xs', '(1... |
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from error.models import Error, Group
from projects.models import Project, ProjectURL
from app.tests import test_data
class ProjectTests(TestCase):
fixtures = ['users.json']
def _addError(se... | [
"django.test.client.Client",
"error.models.Error.objects.all",
"django.core.urlresolvers.reverse",
"projects.models.Project",
"error.models.Group.objects.count",
"error.models.Group.objects.all",
"projects.models.ProjectURL"
] | [((337, 345), 'django.test.client.Client', 'Client', ([], {}), '()\n', (343, 345), False, 'from django.test.client import Client\n'), ((604, 624), 'projects.models.Project', 'Project', ([], {'name': '"""test"""'}), "(name='test')\n", (611, 624), False, 'from projects.models import Project, ProjectURL\n'), ((882, 902), ... |
import re
import pytest
from invoke.context import Context
from test.test_utils.benchmark import execute_single_node_benchmark, get_py_version
@pytest.mark.skip(reason="Temp skip due to timeout")
@pytest.mark.model("resnet18_v2")
@pytest.mark.integration("cifar10 dataset")
def test_performance_mxnet_cpu(mxnet_traini... | [
"pytest.mark.integration",
"pytest.mark.skip",
"pytest.mark.model",
"test.test_utils.benchmark.get_py_version",
"invoke.context.Context",
"test.test_utils.benchmark.execute_single_node_benchmark"
] | [((147, 198), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""Temp skip due to timeout"""'}), "(reason='Temp skip due to timeout')\n", (163, 198), False, 'import pytest\n'), ((200, 232), 'pytest.mark.model', 'pytest.mark.model', (['"""resnet18_v2"""'], {}), "('resnet18_v2')\n", (217, 232), False, 'import py... |
#!/usr/bin/env python
import csv
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy
from onadata.apps.logger.models import Instance
from onadata.libs.utils.model_tools import queryset_iterator
class Command(BaseCommand):
help = ugettext_lazy("Export all gps po... | [
"csv.writer",
"django.utils.translation.ugettext_lazy",
"onadata.apps.logger.models.Instance.objects.exclude"
] | [((288, 348), 'django.utils.translation.ugettext_lazy', 'ugettext_lazy', (['"""Export all gps points with their timestamps"""'], {}), "('Export all gps points with their timestamps')\n", (301, 348), False, 'from django.utils.translation import ugettext_lazy\n'), ((537, 556), 'csv.writer', 'csv.writer', (['csvfile'], {}... |
SQFT = 10000
numPeople = SQFT/250
numDevices = numPeople*2
numSpaces = SQFT/500
import copy
IDs = []
for i in range(numPeople):
newID = "P" + str(i)
IDs.append(newID)
D = []
for i in range(numDevices):
newDevice = "D" + str(i)
D.append(newDevice)
DO = []
S = []
for i in range(numSpaces):
newSpace = "S" + str(i)
... | [
"datetime.datetime",
"random.uniform",
"copy.copy",
"random.randint"
] | [((355, 367), 'copy.copy', 'copy.copy', (['S'], {}), '(S)\n', (364, 367), False, 'import copy\n'), ((995, 1025), 'datetime.datetime', 'datetime.datetime', (['(2018)', '(6)', '(21)'], {}), '(2018, 6, 21)\n', (1012, 1025), False, 'import datetime\n'), ((1363, 1393), 'datetime.datetime', 'datetime.datetime', (['(2018)', '... |
from django.db import models
# Create your models here.
class State(models.Model):
ACTIVE_CHOICES = (
(0,'Inactive'),
(1, 'Active'),
)
statecode = models.CharField(max_length=2, unique=True, primary_key=True)
name = models.CharField(max_length=50)
active = models.IntegerField(ch... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.IntegerField"
] | [((180, 241), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2)', 'unique': '(True)', 'primary_key': '(True)'}), '(max_length=2, unique=True, primary_key=True)\n', (196, 241), False, 'from django.db import models\n'), ((253, 284), 'django.db.models.CharField', 'models.CharField', ([], {'max_len... |
import os
import unittest
from flask import request
from beacons import app
if 'DB_NAME' not in os.environ:
os.environ['DATABASE_URI'] = 'sqlite://'
os.environ['DB_NAME'] = ':memory:'
class TestViews(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_E... | [
"unittest.TestSuite",
"beacons.app.test_client",
"os.environ.get",
"beacons.app.test_request_context",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((1629, 1649), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (1647, 1649), False, 'import unittest\n'), ((466, 483), 'beacons.app.test_client', 'app.test_client', ([], {}), '()\n', (481, 483), False, 'from beacons import app\n'), ((388, 418), 'os.environ.get', 'os.environ.get', (['"""DATABASE_URI"""'],... |
""" Support for Mongoengine ODM.
.. note:: Support for Mongoengine_ is in early development.
::
from mixer.backend.mongoengine import mixer
class User(Document):
created_at = DateTimeField(default=datetime.datetime.now)
email = EmailField(required=True)
first_name = StringField(max_l... | [
"bson.ObjectId"
] | [((1397, 1407), 'bson.ObjectId', 'ObjectId', ([], {}), '()\n', (1405, 1407), False, 'from bson import ObjectId\n')] |
# coding: utf-8
import sys
sys.path.append(".")
from workshop.fr.z_1 import *
signalerErreurs = True
"""
- si à 'True', vérification de la validité des valeurs en amont,
- si à 'False', pas de vérifications; si valeur invalide, ce sont les exceptions Python qui sont affichées.
"""
def resoudreEquatio... | [
"sys.path.append"
] | [((31, 51), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (46, 51), False, 'import sys\n')] |
import unittest
from deckbuilder.Gloss import Gloss
class TestGloss(unittest.TestCase):
def test_gloss(self):
gloss = Gloss()
result = gloss.fetch_glosses('よく晴れた夜空')
self.assertEqual(len(result), 3)
def test_clean_gloss_front(self):
gloss = Gloss()
text1 = ' 夜空 【よぞら】 (... | [
"unittest.skip",
"deckbuilder.Gloss.Gloss"
] | [((8584, 8648), 'unittest.skip', 'unittest.skip', (['"""this would look nicer but I don\'t actually care"""'], {}), '("this would look nicer but I don\'t actually care")\n', (8597, 8648), False, 'import unittest\n'), ((130, 137), 'deckbuilder.Gloss.Gloss', 'Gloss', ([], {}), '()\n', (135, 137), False, 'from deckbuilder... |
# 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 by applicable law or agr... | [
"textwrap.dedent",
"argparse.ArgumentParser",
"re.compile",
"nl_api.xml2entities.main",
"argparse.ArgumentTypeError"
] | [((771, 810), 're.compile', 're.compile', (['"""([\\\\w.:-]+:)?\\\\w+\\\\.\\\\w+$"""'], {}), "('([\\\\w.:-]+:)?\\\\w+\\\\.\\\\w+$')\n", (781, 810), False, 'import re\n'), ((1261, 1364), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.RawDescriptionHelpF... |
"""
Neural Network to implement AND gate using McCulloch-Pitts Neuron Model.
"""
import numpy as np
from .neurons import neuron
def main():
print("\n*** Neural Network for AND Operation ***")
print("\ny = x1 . x2")
x1 = np.array([0, 0, 1, 1])
x2 = np.array([0, 1, 0, 1])
y: np.array = np.logical... | [
"numpy.array",
"numpy.logical_and"
] | [((236, 258), 'numpy.array', 'np.array', (['[0, 0, 1, 1]'], {}), '([0, 0, 1, 1])\n', (244, 258), True, 'import numpy as np\n'), ((268, 290), 'numpy.array', 'np.array', (['[0, 1, 0, 1]'], {}), '([0, 1, 0, 1])\n', (276, 290), True, 'import numpy as np\n'), ((310, 332), 'numpy.logical_and', 'np.logical_and', (['x1', 'x2']... |
"""
Support for zeptrion_air_api.button.
For more details about this Class, please refer to the documentation at
https://github.com/swissglider/zeptrionAirApi
"""
import xml.etree.ElementTree as ET
import requests
class Button:
"""The Button is the base class of all buttons."""
def __init__(self, panel, in... | [
"xml.etree.ElementTree.fromstring",
"requests.post",
"requests.get"
] | [((3484, 3521), 'requests.post', 'requests.post', (['full_url'], {'data': 'payload'}), '(full_url, data=payload)\n', (3497, 3521), False, 'import requests\n'), ((3765, 3802), 'requests.post', 'requests.post', (['full_url'], {'data': 'payload'}), '(full_url, data=payload)\n', (3778, 3802), False, 'import requests\n'), (... |
import datetime
import itertools
from typing import NamedTuple, List
import structlog
from web3.datastructures import AttributeDict
from monitor.db import AlreadyExists
from monitor import blocksel
class BlockFetcherStateV1(NamedTuple):
head: AttributeDict
current_branch: List[AttributeDict]
initial_blo... | [
"structlog.get_logger",
"datetime.datetime.utcfromtimestamp",
"monitor.blocksel.ResolveGenesisBlock"
] | [((713, 758), 'structlog.get_logger', 'structlog.get_logger', (['"""monitor.block_fetcher"""'], {}), "('monitor.block_fetcher')\n", (733, 758), False, 'import structlog\n'), ((427, 478), 'datetime.datetime.utcfromtimestamp', 'datetime.datetime.utcfromtimestamp', (['block.timestamp'], {}), '(block.timestamp)\n', (461, 4... |
#!/usr/bin/env python
import pathlib
import datetime
import logging
import click
from libs.datasets import data_version
from libs.pipelines import can_model_pipeline
_logger = logging.getLogger(__name__)
@click.group('model')
def main():
"""Run models"""
pass
@main.command("county")
@click.option("--state"... | [
"logging.getLogger",
"datetime.datetime",
"logging.basicConfig",
"pathlib.Path",
"click.group",
"click.option",
"libs.pipelines.can_model_pipeline.run_state_level_forecast",
"libs.pipelines.can_model_pipeline.run_county_level_forecast"
] | [((177, 204), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (194, 204), False, 'import logging\n'), ((208, 228), 'click.group', 'click.group', (['"""model"""'], {}), "('model')\n", (219, 228), False, 'import click\n'), ((298, 327), 'click.option', 'click.option', (['"""--state"""', '"""-... |
from django.conf.urls import include
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
path('wiebetaaltwat/', include('wiebetaaltwat.urls')),
path('', include('orders.urls')),
]
| [
"django.conf.urls.include",
"django.urls.path"
] | [((120, 151), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (124, 151), False, 'from django.urls import path\n'), ((180, 209), 'django.conf.urls.include', 'include', (['"""wiebetaaltwat.urls"""'], {}), "('wiebetaaltwat.urls')\n", (187, 209), False, 'from django.... |
"""
Decision Tree Model using scikit-learn implementation
"""
from sklearn import tree
import classifier_subsystem.model
import utils.classify_util as classify_utils
if __name__ == "__main__":
# load data
X_train, X_val, y_train, y_val = classify_utils.load_train_data(clean=True)
# define model
mo... | [
"sklearn.tree.DecisionTreeClassifier",
"utils.classify_util.load_train_data"
] | [((251, 293), 'utils.classify_util.load_train_data', 'classify_utils.load_train_data', ([], {'clean': '(True)'}), '(clean=True)\n', (281, 293), True, 'import utils.classify_util as classify_utils\n'), ((326, 355), 'sklearn.tree.DecisionTreeClassifier', 'tree.DecisionTreeClassifier', ([], {}), '()\n', (353, 355), False,... |
import signal
import sys
import socket
import optparse
import video
import controls
import time
import hashlib
import controls
class Main:
def signal_handler(self, signal, frame):
self.finish();
def finish(self):
self.clear_session()
self.sock.close()
sys.exit(0);
def aut... | [
"signal.signal",
"socket.socket",
"optparse.OptionParser",
"sys.exit",
"video.VideoStreamer",
"controls.Movement"
] | [((295, 306), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (303, 306), False, 'import sys\n'), ((1063, 1167), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': "('OPTIONS:\\n' + '--videoport <video port> --controlport <controls port>')"}), "(usage='OPTIONS:\\n' +\n '--videoport <video port> --contr... |
import argparse as ap
import time
# Define arguments
parser = ap.ArgumentParser(description='An interpreter for XEPro')
parser.add_argument('-v', action='store_true', help='Verbose mode, says what commands it finds and what its doing.')
parser.add_argument('-d', action='store_true', help='Debug mode, displays th... | [
"os.system",
"argparse.FileType",
"argparse.ArgumentParser",
"os.remove"
] | [((67, 124), 'argparse.ArgumentParser', 'ap.ArgumentParser', ([], {'description': '"""An interpreter for XEPro"""'}), "(description='An interpreter for XEPro')\n", (84, 124), True, 'import argparse as ap\n'), ((547, 563), 'argparse.FileType', 'ap.FileType', (['"""r"""'], {}), "('r')\n", (558, 563), True, 'import argpar... |
import pandas as pd
import matplotlib.pyplot as plt
import os
# Set working directory
os.chdir('/Users/dayanesallet/Documents/_Educação/Data Analyst Nanodegree/Weather Project/Data')
# Import data
PortoAlegre_temp = pd.read_csv('./PortoAlegre_Temperature_Data.csv')
World_temp = pd.read_csv('./World_Temperature_Data.... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis",
"os.chdir",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib... | [((86, 194), 'os.chdir', 'os.chdir', (['"""/Users/dayanesallet/Documents/_Educação/Data Analyst Nanodegree/Weather Project/Data"""'], {}), "(\n '/Users/dayanesallet/Documents/_Educação/Data Analyst Nanodegree/Weather Project/Data'\n )\n", (94, 194), False, 'import os\n'), ((219, 268), 'pandas.read_csv', 'pd.r... |
import webbrowser
class Movie():
"""This class provides a way to store movie related information"""
# Class constructor
def __init__(self, movie_title, movie_storyline, movie_duration, poster_image, trailer_youtube):
"""
Attributes:
movie_title (str): Name of movie
... | [
"webbrowser.open"
] | [((861, 902), 'webbrowser.open', 'webbrowser.open', (['self.trailer_youtube_url'], {}), '(self.trailer_youtube_url)\n', (876, 902), False, 'import webbrowser\n')] |
# coding=utf-8
from werobot.reply import create_reply
from .. import client
from openerp.http import request
def main(robot):
@robot.subscribe
def subscribe(message):
from .. import client
entry = client.wxenv(request.env)
serviceid = message.target
openid = message.source
... | [
"openerp.http.request.env"
] | [((432, 445), 'openerp.http.request.env', 'request.env', ([], {}), '()\n', (443, 445), False, 'from openerp.http import request\n'), ((915, 928), 'openerp.http.request.env', 'request.env', ([], {}), '()\n', (926, 928), False, 'from openerp.http import request\n')] |
import torch
from torch import nn
from maskrcnn_benchmark.modeling.poolers import LevelMapper
from maskrcnn_benchmark.modeling.utils import cat
from maskrcnn_benchmark.layers import ROIAlign
class SRPooler(nn.Module):
"""
SRPooler for Detection with or without FPN.
Also, the requirement of passing the sc... | [
"torch.nn.ModuleList",
"torch.nonzero",
"torch.tensor",
"maskrcnn_benchmark.modeling.poolers.LevelMapper",
"maskrcnn_benchmark.modeling.utils.cat",
"maskrcnn_benchmark.layers.ROIAlign",
"torch.zeros",
"torch.cat"
] | [((1092, 1114), 'torch.nn.ModuleList', 'nn.ModuleList', (['poolers'], {}), '(poolers)\n', (1105, 1114), False, 'from torch import nn\n'), ((1492, 1521), 'maskrcnn_benchmark.modeling.poolers.LevelMapper', 'LevelMapper', (['lvl_min', 'lvl_max'], {}), '(lvl_min, lvl_max)\n', (1503, 1521), False, 'from maskrcnn_benchmark.m... |
import logging
from datetime import timedelta
from src.alerter.factory.alerting_factory import AlertingFactory
from src.alerter.grouped_alerts_metric_code.node.evm_node_metric_code \
import GroupedEVMNodeAlertsMetricCode as AlertsMetricCode
from src.configs.alerts.node.evm import EVMNodeAlertsConfig
from src.utils... | [
"datetime.timedelta",
"src.utils.configs.parse_alert_time_thresholds"
] | [((2963, 3099), 'src.utils.configs.parse_alert_time_thresholds', 'parse_alert_time_thresholds', (["['warning_threshold', 'critical_threshold', 'critical_repeat']", 'evm_node_alerts_config.evm_node_is_down'], {}), "(['warning_threshold', 'critical_threshold',\n 'critical_repeat'], evm_node_alerts_config.evm_node_is_d... |
import pygame, sys, os
from pygame.locals import *
# Content Manager
class Content:
# Builds a Content Manager to a relative path
def __init__(self, path):
self.path = path
# Tries to load an image
# colorkey: -1, (255,255,255), None
def load_image(self, name, colorkey=None, scale=1,):
... | [
"pygame.transform.smoothscale",
"os.path.join",
"pygame.mixer.Sound",
"pygame.transform.scale2x",
"pygame.error",
"pygame.image.load"
] | [((336, 365), 'os.path.join', 'os.path.join', (['self.path', 'name'], {}), '(self.path, name)\n', (348, 365), False, 'import pygame, sys, os\n'), ((1322, 1351), 'os.path.join', 'os.path.join', (['self.path', 'name'], {}), '(self.path, name)\n', (1334, 1351), False, 'import pygame, sys, os\n'), ((399, 426), 'pygame.imag... |
# 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
# distributed under t... | [
"pytest.fixture",
"pytest.mark.parametrize",
"os.environ.get",
"influxdb.InfluxDBClient"
] | [((1645, 1675), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1659, 1675), False, 'import pytest\n'), ((3114, 3144), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (3128, 3144), False, 'import pytest\n'), ((3224, 3254), 'pytest.fi... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import base64
import glob
from scipy.signal import medfilt
from scipy.integrate import trapz
import xml.etree.ElementTree as et
from datetime import date
today = date.today()
np.warnings.filterwarnings('ignore')
... | [
"seaborn.set",
"pandas.pivot_table",
"numpy.repeat",
"xml.etree.ElementTree.parse",
"numpy.asarray",
"numpy.diff",
"numpy.linspace",
"pandas.DataFrame",
"glob.glob",
"numpy.abs",
"numpy.warnings.filterwarnings",
"numpy.isnan",
"datetime.date.today",
"numpy.median",
"base64.b64decode",
... | [((266, 278), 'datetime.date.today', 'date.today', ([], {}), '()\n', (276, 278), False, 'from datetime import date\n'), ((282, 318), 'numpy.warnings.filterwarnings', 'np.warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (308, 318), True, 'import numpy as np\n'), ((320, 345), 'seaborn.set', 'sns.set', ([... |
import os
import numpy as np
import crepe
# this data contains a sine sweep
file = os.path.join(os.path.dirname(__file__), 'sweep.wav')
f0_file = os.path.join(os.path.dirname(__file__), 'sweep.f0.csv')
def verify_f0():
result = np.loadtxt(f0_file, delimiter=',', skiprows=1)
# it should be confident enough a... | [
"numpy.mean",
"numpy.allclose",
"torch.as_tensor",
"numpy.corrcoef",
"crepe.predict",
"crepe.torch_backend.DataHelper",
"os.path.dirname",
"crepe.core.get_frames",
"torch.cuda.is_available",
"functools.partial",
"scipy.io.wavfile.read",
"crepe.process_file",
"numpy.loadtxt",
"os.remove"
] | [((97, 122), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (112, 122), False, 'import os\n'), ((160, 185), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (175, 185), False, 'import os\n'), ((235, 281), 'numpy.loadtxt', 'np.loadtxt', (['f0_file'], {'delimiter': '"""... |
import numpy as np
import collections
class Hopfield():
"""
The hopfield network in the simplest case of AMIT book in attractor neural network
"""
def __init__(self, n_dim=3, T=0, prng=np.random):
self.prng = prng
self.n_dim = n_dim
self.s = np.sign(prng.normal(size=n_dim))
... | [
"numpy.mean",
"numpy.diag_indices_from",
"numpy.copy",
"collections.deque",
"numpy.ones",
"numpy.sqrt",
"numpy.zeros",
"numpy.outer",
"numpy.dot",
"numpy.sign",
"numpy.linalg.norm"
] | [((337, 352), 'numpy.zeros', 'np.zeros', (['n_dim'], {}), '(n_dim)\n', (345, 352), True, 'import numpy as np\n'), ((1001, 1035), 'numpy.zeros', 'np.zeros', (['(self.n_dim, self.n_dim)'], {}), '((self.n_dim, self.n_dim))\n', (1009, 1035), True, 'import numpy as np\n'), ((1884, 1899), 'numpy.sign', 'np.sign', (['self.h']... |
"""
Datasets Validation Tests
"""
import os
import unittest
from sdmxthon.testSuite import TestHelper
class DatasetsValidation(TestHelper.TestHelper):
path = os.path.dirname(__file__)
pathToDB = os.path.join(os.path.join(path, "data"), "data_sample")
pathToMetadata = os.path.join(os.path.join(path, "data... | [
"unittest.main",
"os.path.dirname",
"os.path.join"
] | [((165, 190), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (180, 190), False, 'import os\n'), ((783, 809), 'unittest.main', 'unittest.main', ([], {'verbosity': '(1)'}), '(verbosity=1)\n', (796, 809), False, 'import unittest\n'), ((219, 245), 'os.path.join', 'os.path.join', (['path', '"""dat... |
from os.path import abspath, dirname, join, normpath
from setuptools import setup
setup(
# Basic package information:
name = 'django-clear-cache',
version = '0.3',
packages = (
'clear_cache',
'clear_cache.management',
'clear_cache.management.commands'
),
# Packaging ... | [
"os.path.abspath"
] | [((807, 824), 'os.path.abspath', 'abspath', (['__file__'], {}), '(__file__)\n', (814, 824), False, 'from os.path import abspath, dirname, join, normpath\n')] |
from django.contrib.auth.models import User
from django.db import models, transaction
# Create your models here.
# add dates of review, signed date, who signed, grant agreement - need flexibilty in types of dates that are added
from django.db.models import Sum
from django.utils.datetime_safe import datetime
from simple... | [
"django.db.models.OneToOneField",
"django.db.models.Sum",
"django.db.models.DateField",
"django.db.models.TextField",
"storages.backends.s3boto3.S3Boto3Storage",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.transaction.atomic",
"project_core.utils.utils.management_file_... | [((778, 891), 'django.db.models.OneToOneField', 'models.OneToOneField', (['Project'], {'help_text': '"""Project this Grant Agreement belongs to"""', 'on_delete': 'models.PROTECT'}), "(Project, help_text=\n 'Project this Grant Agreement belongs to', on_delete=models.PROTECT)\n", (798, 891), False, 'from django.db imp... |
#!/usr/bin/env python
from util.angle import get_euler_orientation
class Controller:
def __init__(self, trajectory, simulation_data):
self.trajectory = trajectory
self.simulation_time = simulation_data['time']
self.delta = simulation_data['delta']
def set_current_orientation(self, ori... | [
"util.angle.get_euler_orientation"
] | [((354, 388), 'util.angle.get_euler_orientation', 'get_euler_orientation', (['orientation'], {}), '(orientation)\n', (375, 388), False, 'from util.angle import get_euler_orientation\n')] |
import numpy as np
import pandas as pd
from sklearn import preprocessing
def get_data():
# Read excel file
File = pd.ExcelFile('data.xlsx')
File.sheet_names
df = File.parse('D1')
# seprate data and label
# x = np.array(df.drop(['label'],1))
# y = np.array(df['label'])
# preprocessing
... | [
"pandas.ExcelFile",
"sklearn.preprocessing.scale"
] | [((125, 150), 'pandas.ExcelFile', 'pd.ExcelFile', (['"""data.xlsx"""'], {}), "('data.xlsx')\n", (137, 150), True, 'import pandas as pd\n'), ((325, 348), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['df'], {}), '(df)\n', (344, 348), False, 'from sklearn import preprocessing\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# code for python2.7
#
#
import rospy
import serial
import time
import signal
import sys
import math
import tf
from nav_msgs.msg import Odometry
from whipbot.msg import Posture_angle
from kondo_b3mservo_rosdriver.msg import Multi_servo_info
# variables to store timings o... | [
"nav_msgs.msg.Odometry",
"rospy.Subscriber",
"rospy.is_shutdown",
"rospy.logwarn",
"rospy.get_param",
"rospy.init_node",
"math.sin",
"math.cos",
"tf.transformations.quaternion_from_euler",
"rospy.Rate",
"rospy.Publisher",
"time.time"
] | [((349, 360), 'time.time', 'time.time', ([], {}), '()\n', (358, 360), False, 'import time\n'), ((373, 384), 'time.time', 'time.time', ([], {}), '()\n', (382, 384), False, 'import time\n'), ((1550, 1593), 'rospy.get_param', 'rospy.get_param', (['"""~pulse_per_round"""', '(4096.0)'], {}), "('~pulse_per_round', 4096.0)\n"... |
import os
import sys
import django
import djcelery
BASE_PATH = os.path.dirname(__file__)
def main():
"""
Standalone django model test with a 'memory-only-django-installation'.
You can play with a django model without a complete django app installation
http://www.djangosnippets.org/snippets/1044/
... | [
"django.setup",
"djcelery.setup_loader",
"sys.exc_clear",
"os.path.join",
"django.test.utils.get_runner",
"os.path.dirname",
"sys.exit"
] | [((64, 89), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (79, 89), False, 'import os\n'), ((328, 343), 'sys.exc_clear', 'sys.exc_clear', ([], {}), '()\n', (341, 343), False, 'import sys\n'), ((771, 794), 'djcelery.setup_loader', 'djcelery.setup_loader', ([], {}), '()\n', (792, 794), False, ... |
from itertools import islice
from itertools import islice
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch.autograd import Variable
from torch import utils
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
import pickle
from torchvision import datasets... | [
"numpy.transpose",
"torch.nn.functional.mse_loss",
"torch.nn.ReLU",
"torchvision.transforms.ToTensor",
"matplotlib.pyplot.ylabel",
"conv_utils.DCT",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"torchvision.transforms.Scale",
"torch.nn.Conv2d",
"torchvision.transforms.RandomCrop",
"to... | [((11196, 11218), 'matplotlib.pyplot.plot', 'plt.plot', (['loss_history'], {}), '(loss_history)\n', (11204, 11218), True, 'import matplotlib.pyplot as plt\n'), ((11219, 11242), 'matplotlib.pyplot.title', 'plt.title', (['"""Model loss"""'], {}), "('Model loss')\n", (11228, 11242), True, 'import matplotlib.pyplot as plt\... |
from buck import format_watchman_query_params, glob_internal, LazyBuildEnvPartial
from buck import subdir_glob, BuildFileContext
from pathlib import Path, PurePosixPath, PureWindowsPath
import os
import shutil
import tempfile
import unittest
class FakePathMixin(object):
def glob(self, pattern):
return sel... | [
"buck.subdir_glob",
"os.makedirs",
"buck.LazyBuildEnvPartial",
"buck.BuildFileContext",
"pathlib.Path",
"os.path.join",
"buck.format_watchman_query_params",
"buck.glob_internal",
"tempfile.mkdtemp",
"shutil.rmtree",
"unittest.main"
] | [((11248, 11263), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11261, 11263), False, 'import unittest\n'), ((3481, 3545), 'buck.BuildFileContext', 'BuildFileContext', (['None', 'None', 'None', 'None', 'None', 'None', 'None', 'None'], {}), '(None, None, None, None, None, None, None, None)\n', (3497, 3545), False... |
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
"""XML constants and functions"""
from lxml import etree
# XML NAMESPACES
NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"
# XML TAGS
TAG_XSI_TYPE = "{%s}type" % NS_XSI
TAG_SCHEMALOCATION = "{%s}schemaLocatio... | [
"lxml.etree.ElementTree",
"lxml.etree.parse",
"lxml.etree.fromstring",
"lxml.etree.ETCompatXMLParser"
] | [((880, 1032), 'lxml.etree.ETCompatXMLParser', 'etree.ETCompatXMLParser', ([], {'huge_tree': '(True)', 'remove_comments': '(True)', 'strip_cdata': '(False)', 'remove_blank_text': '(True)', 'resolve_entities': '(False)', 'encoding': 'encoding'}), '(huge_tree=True, remove_comments=True, strip_cdata=\n False, remove_bl... |
"""
Split the dataset according to the id of the tran/val/test split
"""
from data_split_utils import get_path_list
from osgeo import gdal_array
### Vaihingen ###
# id of the split
train_id = '1, 3, 5, 7, 13, 17, 21, 23, 26, 32, 37'
val_id = '11, 15, 28, 30, 34'
train_id = train_id.split(', ')
val_id = val_id.split('... | [
"matplotlib.pyplot.xticks",
"data_split_utils.get_path_list",
"osgeo.gdal_array.LoadFile",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show"
] | [((357, 569), 'data_split_utils.get_path_list', 'get_path_list', ([], {'path': '"""D:\\\\ISPRS\\\\ISPRS 2D Semantic Labeling Contest\\\\vaihingen\\\\ISPRS_semantic_labeling_Vaihingen\\\\top"""', 'prefix': '"""top_mosaic_09cm_area"""', 'suffix': '""".tif"""', 'train_id': 'train_id', 'val_id': 'val_id'}), "(path=\n 'D... |
# coding: utf-8
import numpy as np
import argparse
import torch
import os
from shutil import rmtree
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Bernoulli
from copy import deepcopy
from envs import IPD
# from torch.utils.tensorboard import SummaryWriter
from tensorboardX import... | [
"torch.histc",
"torch.from_numpy",
"envs.IPD",
"os.path.exists",
"numpy.mean",
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"torch.eye",
"torch.nn.functional.kl_div",
"models.SteerablePolicy",
"torch.randn",
"plotting.plot",
"torch.autograd.grad",
"models.PolicyEvaluationNetwor... | [((452, 477), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (475, 477), False, 'import argparse\n'), ((2116, 2137), 'torch.sigmoid', 'torch.sigmoid', (['theta1'], {}), '(theta1)\n', (2129, 2137), False, 'import torch\n'), ((2147, 2185), 'torch.sigmoid', 'torch.sigmoid', (['theta2[[0, 1, 3, 2, ... |
import decimal
from math import log
from modules.__tools_single import bcolors, generate_from_64b_inter_key
from modules.tools import check_text_const, check_rand_rotors, check_patterns, \
check_all_patterns, calc_number_comb, print_long, key_from_64b_to_dec
def test_print(rotors, key_enc = [], key_dec = [], text_b... | [
"modules.tools.check_text_const",
"modules.tools.check_patterns",
"modules.tools.check_rand_rotors",
"modules.tools.print_long",
"modules.tools.check_all_patterns",
"modules.tools.key_from_64b_to_dec",
"modules.__tools_single.generate_from_64b_inter_key",
"modules.tools.calc_number_comb",
"decimal.D... | [((876, 905), 'modules.tools.calc_number_comb', 'calc_number_comb', (['rotors', 'key'], {}), '(rotors, key)\n', (892, 905), False, 'from modules.tools import check_text_const, check_rand_rotors, check_patterns, check_all_patterns, calc_number_comb, print_long, key_from_64b_to_dec\n'), ((647, 691), 'modules.__tools_sing... |
import json
import os
# Parse ISO date
import dateutil.parser as dapa
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
strategy_indices = {
'FIXED': 0,
'OPTIMIZED': 1,
'FINED': 2
}
strategy_labels = {
0: 'FIX({} ,{})',
1: 'OPT({}, {})',
2: 'FIN({}, {})'
}
legend_la... | [
"numpy.mean",
"dateutil.parser.parse",
"os.listdir",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figtext",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.figlegend",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"numpy.round"
... | [((2860, 2879), 'matplotlib.pyplot.savefig', 'plt.savefig', (['output'], {}), '(output)\n', (2871, 2879), True, 'from matplotlib import pyplot as plt\n'), ((2911, 2922), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (2920, 2922), True, 'from matplotlib import pyplot as plt\n'), ((3031, 3054), 'os.listdir', ... |
import logging
from typing import Tuple
import pandas as pd
import numpy as np
from cachetools import cached
from cachetools.keys import hashkey
from . import _get_common_columns
logger = logging.getLogger(__name__)
ACCEPTED_TYPES = ["linear"]
def distance(source: pd.Series, target: pd.Series, answers: pd.DataF... | [
"logging.getLogger",
"numpy.float",
"cachetools.keys.hashkey",
"numpy.isnan",
"numpy.int"
] | [((192, 219), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'import logging\n'), ((1858, 1869), 'numpy.float', 'np.float', (['(0)'], {}), '(0)\n', (1866, 1869), True, 'import numpy as np\n'), ((1829, 1852), 'numpy.isnan', 'np.isnan', (['distance_mean'], {}), '(distance... |
"""Beam search implementation.
TODO:
- incorporate diversity into the rank score so that samples are differet.
"""
import torch
from torch.autograd import Variable
from copy import copy
from .rnn_code_generator import (
load_model, create_metafeature_tensor, create_input_tensor,
sos_index, sos_token, eos_ind... | [
"copy.copy",
"torch.Tensor"
] | [((3022, 3070), 'torch.Tensor', 'torch.Tensor', (['[c.prob_score for c in candidates]'], {}), '([c.prob_score for c in candidates])\n', (3034, 3070), False, 'import torch\n'), ((3667, 3686), 'copy.copy', 'copy', (['self.sequence'], {}), '(self.sequence)\n', (3671, 3686), False, 'from copy import copy\n')] |
"""Tests for the jit_open library."""
from fake_open import FakeOpen
from jit_open import jit_open, Handle, Queue
class TestLibrary(object):
def setup(self):
fake_open = FakeOpen()
self._handles = fake_open.handles
self._open = fake_open.open
self._queue = Queue()
def test_u... | [
"jit_open.Queue",
"jit_open.Handle",
"fake_open.FakeOpen"
] | [((185, 195), 'fake_open.FakeOpen', 'FakeOpen', ([], {}), '()\n', (193, 195), False, 'from fake_open import FakeOpen\n'), ((297, 304), 'jit_open.Queue', 'Queue', ([], {}), '()\n', (302, 304), False, 'from jit_open import jit_open, Handle, Queue\n'), ((350, 400), 'jit_open.Handle', 'Handle', (['"""test.txt"""', 'self._q... |
# Generated by Django 3.1 on 2020-10-30 10:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.migrations.swappable_dependency"
] | [((245, 302), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (276, 302), False, 'from django.db import migrations, models\n'), ((438, 531), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import os
from pytest import yield_fixture
from .helpers import setup
from ..api import VersionedHDF5File
@yield_fixture
def h5file(tmp_path, request):
file_name = os.path.join(tmp_path, 'file.hdf5')
name = None
version_name = None
m = request.node.get_closest_marker('setup_args')
if m is not None... | [
"os.path.join"
] | [((170, 205), 'os.path.join', 'os.path.join', (['tmp_path', '"""file.hdf5"""'], {}), "(tmp_path, 'file.hdf5')\n", (182, 205), False, 'import os\n')] |
import collections
from nose.tools import assert_raises
from syn.sets import SetWrapper, TypeWrapper
from syn.util.constraint import Domain, Constraint, Problem
#-------------------------------------------------------------------------------
# Domain
def test_domain():
d = Domain()
d['a'] = [1]
assert d['... | [
"syn.sets.SetWrapper",
"syn.sets.TypeWrapper",
"syn.util.constraint.EqualConstraint",
"nose.tools.assert_raises",
"syn.util.constraint.Domain",
"syn.util.constraint.Constraint"
] | [((280, 288), 'syn.util.constraint.Domain', 'Domain', ([], {}), '()\n', (286, 288), False, 'from syn.util.constraint import Domain, Constraint, Problem\n'), ((475, 501), 'syn.util.constraint.Domain', 'Domain', ([], {'a': '[1, 2]', 'b': '[3, 4]'}), '(a=[1, 2], b=[3, 4])\n', (481, 501), False, 'from syn.util.constraint i... |
# Copyright (c) 2008-2009 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met: Redistributions of
# source code must retain the above copyright notice, this list of conditions and
# th... | [
"urwid.Divider",
"config.urwid_key_to_key",
"urwid.Text"
] | [((2008, 2034), 'urwid.Text', 'urwid.Text', (['"""Keys\n====\n"""'], {}), "('Keys\\n====\\n')\n", (2018, 2034), False, 'import urwid\n'), ((2131, 2149), 'urwid.Divider', 'urwid.Divider', (['""" """'], {}), "(' ')\n", (2144, 2149), False, 'import urwid\n'), ((2168, 2204), 'urwid.Text', 'urwid.Text', (['"""Commands\n====... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import sys
sys.path.append("..")
from option import args
OPS = {
'none': lambda C, stride, affine: Zero(stride),
'avg_pool_3x3': lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_include_pad=False),... | [
"torch.nn.functional.conv2d",
"torch.nn.ReLU",
"torch.nn.Tanh",
"torch.nn.Sequential",
"torch.nn.InstanceNorm2d",
"math.log",
"torch.nn.functional.interpolate",
"torch.nn.functional.pad",
"torch.nn.AvgPool2d",
"sys.path.append",
"torch.nn.BatchNorm2d",
"torch.nn.Sigmoid",
"torch.nn.AdaptiveA... | [((95, 116), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (110, 116), False, 'import sys\n'), ((2708, 2798), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'out_channels', 'kernel_size'], {'padding': '(kernel_size // 2)', 'bias': 'bias'}), '(in_channels, out_channels, kernel_size, padding=ker... |
from datetime import datetime as dt
DATA_COLUMNS = ['date','vendor','charge','credit','total_balance']
DATA_DATE = DATA_COLUMNS[0]
DATA_CHARGE = DATA_COLUMNS[2]
DATA_VENDOR = DATA_COLUMNS[1]
WEBAPP_TITLE = 'My Personal Finances'
WEBAPP_SUBTITLE = "This is a place where I see my money leaving me..."
WEBAPP_GRAPH_TITLE... | [
"datetime.datetime",
"datetime.datetime.today"
] | [((793, 809), 'datetime.datetime', 'dt', (['(2017)', '(10)', '(10)'], {}), '(2017, 10, 10)\n', (795, 809), True, 'from datetime import datetime as dt\n'), ((849, 859), 'datetime.datetime.today', 'dt.today', ([], {}), '()\n', (857, 859), True, 'from datetime import datetime as dt\n')] |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 20:17:53 2019
@author: Brandon
"""
import numpy as np
import matplotlib.pyplot as plt
G=6.67408e-11
MSun=1.989e30
MMe=3.285e23
MV=4.867e24
ME=6.046e24
MMa=6.417e23
MJ=1.899e27
MS=5.685e26
MU=8.682e25
MN=1.024e26
xsuninit=0
ysuninit=0
xearthinit=152.10e9
yearthinit=... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.show"
] | [((1004, 1020), 'matplotlib.pyplot.plot', 'plt.plot', (['XE', 'YE'], {}), '(XE, YE)\n', (1012, 1020), True, 'import matplotlib.pyplot as plt\n'), ((1020, 1030), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (1028, 1030), True, 'import matplotlib.pyplot as plt\n'), ((1031, 1041), 'matplotlib.pyplot.show', 'plt... |
from os import getenv
class Config:
SECURITY_PASSWORD_HASH = getenv(key='SECURITY_PASSWORD_HASH', default='<PASSWORD>')
# Bcrypt is set as default SECURITY_PASSWORD_HASH, which requires a salt
SECURITY_PASSWORD_SALT = getenv(key='SECURITY_PASSWORD_SALT',
default='<PASS... | [
"os.getenv"
] | [((68, 126), 'os.getenv', 'getenv', ([], {'key': '"""SECURITY_PASSWORD_HASH"""', 'default': '"""<PASSWORD>"""'}), "(key='SECURITY_PASSWORD_HASH', default='<PASSWORD>')\n", (74, 126), False, 'from os import getenv\n'), ((233, 291), 'os.getenv', 'getenv', ([], {'key': '"""SECURITY_PASSWORD_SALT"""', 'default': '"""<PASSW... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int16
import pygame
from pygame.locals import *
gyro_x_val=0
gyro_y_val=0
gyro_z_val=0
accel_x_val=0
accel_y_val=0
accel_z_val=0
mag_x_val=0
mag_y_val=0
mag_z_val=0
def gx_callback(data):
global gyro_x_val
gyro_x_val=data.data
def gy_callback(data):
... | [
"pygame.init",
"pygame.event.get",
"rospy.init_node",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.display.quit",
"pygame.display.set_caption",
"rospy.Subscriber",
"pygame.font.SysFont"
] | [((881, 924), 'rospy.init_node', 'rospy.init_node', (['"""listener"""'], {'anonymous': '(True)'}), "('listener', anonymous=True)\n", (896, 924), False, 'import rospy\n'), ((934, 980), 'rospy.Subscriber', 'rospy.Subscriber', (['"""gyro_x"""', 'Int16', 'gx_callback'], {}), "('gyro_x', Int16, gx_callback)\n", (950, 980), ... |
'''
v.0.0.9
LDSReplicate - ESRIDataStore
Copyright 2011 Crown copyright (c)
Land Information New Zealand and the New Zealand Government.
All rights reserved
This program is released under the terms of the new BSD license. See the
LICENSE file for more information.
ESRI specific DS class super classing ESRI based d... | [
"lds.LDSUtilities.LDSUtilities.setupLogging",
"lds.ProjectionReference.Projection.modifyMorphedSpatialReference"
] | [((695, 722), 'lds.LDSUtilities.LDSUtilities.setupLogging', 'LDSUtilities.setupLogging', ([], {}), '()\n', (720, 722), False, 'from lds.LDSUtilities import LDSUtilities\n'), ((2938, 2984), 'lds.ProjectionReference.Projection.modifyMorphedSpatialReference', 'Projection.modifyMorphedSpatialReference', (['sref'], {}), '(s... |
# Shim module that makes asn1crypto aware of OIDs relevant for EdDSA support
# Will be removed once asn1crypto supports these OIDs natively
from asn1crypto import algos, core, keys, cms, x509
from asn1crypto._errors import unwrap
PRIVATE_KEY_SPECS = {
'rsa': keys.RSAPrivateKey,
'rsassa_pss': keys.RSAPrivateK... | [
"pyhanko_certvalidator._eddsa_oids.register_eddsa_oids",
"asn1crypto._errors.unwrap"
] | [((2087, 2166), 'asn1crypto._errors.unwrap', 'unwrap', (['"""\n Signature algorithm not known for %s\n """', 'algorithm'], {}), '("""\n Signature algorithm not known for %s\n """, algorithm)\n', (2093, 2166), False, 'from asn1crypto._errors import unwrap\n'), ((3142, 3216), 'asn1crypto._erro... |
import wsgiref.handlers
import logging
import os
from google.appengine.api.taskqueue import Task
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from google.appengine.ext.db import GeoPt
from data_model import RouteListing
from data_model im... | [
"logging.getLogger",
"google.appengine.ext.webapp.WSGIApplication",
"google.appengine.ext.db.put",
"data_model.StopLocation",
"google.appengine.ext.db.GqlQuery",
"google.appengine.ext.db.GeoPt",
"logging.info"
] | [((2985, 3107), 'google.appengine.ext.webapp.WSGIApplication', 'webapp.WSGIApplication', (["[('/gtfs/port/stops', PortStopsHandler), ('/gtfs/port/stop/task/',\n PortStopTask)]"], {'debug': '(True)'}), "([('/gtfs/port/stops', PortStopsHandler), (\n '/gtfs/port/stop/task/', PortStopTask)], debug=True)\n", (3007, 31... |
"""
Defining standard tensorflow layers as modules.
"""
import tensorflow as tf
from deeplearning import module
from deeplearning import tf_util as U
import numpy as np
class Input(module.Module):
ninputs=0
class Placeholder(Input):
def __init__(self, dtype, shape, name, default=None):
super().__init... | [
"tensorflow.variance_scaling_initializer",
"deeplearning.tf_util.batch_to_seq",
"tensorflow.layers.flatten",
"numpy.repeat",
"tensorflow.losses.softmax_cross_entropy",
"tensorflow.placeholder",
"deeplearning.tf_util.seq_to_batch",
"tensorflow.placeholder_with_default",
"numpy.zeros",
"tensorflow.s... | [((3068, 3108), 'numpy.zeros', 'np.zeros', (['(nlstm * 2,)'], {'dtype': 'np.float32'}), '((nlstm * 2,), dtype=np.float32)\n', (3076, 3108), True, 'import numpy as np\n'), ((3550, 3592), 'deeplearning.tf_util.batch_to_seq', 'U.batch_to_seq', (['M', 'self.nbatch', 'self.nstep'], {}), '(M, self.nbatch, self.nstep)\n', (35... |
# SPDX-License-Identifier: BSD-2-Clause
import re
import pathlib
import asyncio
import platform
import discord
import toml
import appdirs
if platform.system() == "OpenBSD":
import openbsd
import commands
from text_transform import process_text
async def safely_replace_substr(text, substr, new_substr):
""" ... | [
"toml.dump",
"text_transform.process_text",
"re.compile",
"discord.Game",
"openbsd.unveil",
"appdirs.user_config_dir",
"re.match",
"openbsd.pledge",
"commands.primary_aliases_per_category.items",
"platform.system",
"toml.load",
"asyncio.sleep",
"discord.Client",
"asyncio.set_event_loop",
... | [((5541, 5586), 'commands.primary_aliases_per_category.items', 'commands.primary_aliases_per_category.items', ([], {}), '()\n', (5584, 5586), False, 'import commands\n'), ((5761, 5863), 'discord.Embed', 'discord.Embed', ([], {'title': '"""**Basic Usage of pipe|bot**"""', 'description': 'basic_description', 'color': '(1... |
import argparse
import string
from nltk.corpus import stopwords
from nltk.util import ngrams
from nltk.lm import NgramCounter
from sklearn.feature_extraction.text import CountVectorizer
import pandas as pd
import numpy as np
from tqdm import tqdm
import parmap
import os, pickle
from multiprocessing import Pool
from ite... | [
"time.ctime",
"pandas.to_timedelta",
"nltk.corpus.stopwords.words",
"argparse.ArgumentParser",
"pandas.read_csv",
"sklearn.feature_extraction.text.CountVectorizer",
"os.path.join",
"nltk.lm.NgramCounter",
"numpy.max",
"nltk.util.ngrams",
"multiprocessing.Pool",
"numpy.min",
"numpy.timedelta6... | [((385, 512), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Preprocess notes, extract ventilation duration, and prepare for running MixEHR"""'}), "(description=\n 'Preprocess notes, extract ventilation duration, and prepare for running MixEHR'\n )\n", (408, 512), False, 'import ar... |
from collections import deque
from constants import section_break_token,line_start_token
import os
import pickle
from pymongo import MongoClient
def add_to_trie(trie, tokens, depth):
history = deque(maxlen=depth)
for leaf_token in tokens:
trie[0] += 1
history.append(leaf_token)
for i in... | [
"pickle.dump",
"pymongo.MongoClient",
"collections.deque"
] | [((1978, 2025), 'pymongo.MongoClient', 'MongoClient', (["os.environ['MONGO_CONNECTION_URI']"], {}), "(os.environ['MONGO_CONNECTION_URI'])\n", (1989, 2025), False, 'from pymongo import MongoClient\n'), ((198, 217), 'collections.deque', 'deque', ([], {'maxlen': 'depth'}), '(maxlen=depth)\n', (203, 217), False, 'from coll... |
from src.results.latex import generate_latex_information
from src.comparison.testing import tost_test, ttest_paired
from src.results.main import print_graph_information, print_hypothesis_testing
from src.algorithms.main import execute_algorithms
import matplotlib.pyplot as plt
dpi = 96
plt.rcParams["figure.figsize"] ... | [
"src.algorithms.main.execute_algorithms",
"src.results.latex.generate_latex_information",
"src.results.main.print_graph_information"
] | [((1005, 1045), 'src.algorithms.main.execute_algorithms', 'execute_algorithms', (['file_path', 'delimiter'], {}), '(file_path, delimiter)\n', (1023, 1045), False, 'from src.algorithms.main import execute_algorithms\n'), ((1055, 1110), 'src.results.latex.generate_latex_information', 'generate_latex_information', (['name... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import sys
pyver = float('%s.%s' % sys.version_info[:2])
import aenum
import doctest
import os
import shutil
import tempfile
import textwrap
import unittest
import warnings
from aenum import EnumType, EnumMeta, Enum, IntEnum, StrEnum, LowerStrEnum... | [
"aenum.member.greater_priority_levels.append",
"aenum.enum",
"pickle.dumps",
"sys.exc_info",
"copy.deepcopy",
"unittest.main",
"aenum.Enum",
"aenum.member.name.lower",
"aenum.member",
"textwrap.dedent",
"aenum.auto",
"aenum.IntFlag",
"aenum.unique",
"operator.mod",
"aenum.IntEnum",
"ae... | [((2610, 2673), 'aenum.NamedTuple', 'NamedTuple', (['"""LifeForm"""', '"""branch genus species"""'], {'module': '__name__'}), "('LifeForm', 'branch genus species', module=__name__)\n", (2620, 2673), False, 'from aenum import NamedTuple, TupleSize, NamedConstant, constant, NoAlias, AddValue, Unique\n'), ((3057, 3117), '... |
import itertools
def concatenate(u, words):
"""Concatenates a letter with each word in an iterable."""
for word in words:
yield tuple([u] + list(word))
def shuffle(w1, w2):
"""Computes the shuffle product of two words."""
if len(w1) == 0:
return [w2]
if len(w2) == 0:
ret... | [
"itertools.chain"
] | [((444, 471), 'itertools.chain', 'itertools.chain', (['gen1', 'gen2'], {}), '(gen1, gen2)\n', (459, 471), False, 'import itertools\n')] |
from __future__ import annotations
import abc
from typing import Any, Iterable
import jsonpath_ng
from storage.var import BaseVar
class JsonPath(BaseVar[Any, Any]):
json_path: Any
def __init__(self, json_path):
self.json_path = json_path
@classmethod
def from_str(cls, json_path: str):
... | [
"jsonpath_ng.parse"
] | [((336, 364), 'jsonpath_ng.parse', 'jsonpath_ng.parse', (['json_path'], {}), '(json_path)\n', (353, 364), False, 'import jsonpath_ng\n')] |
# get china stock symbols
from tqdm import tqdm
from time import sleep
from random import randint
from bs4 import BeautifulSoup
from requests import Request
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome... | [
"selenium.webdriver.ChromeOptions",
"webdriver_manager.chrome.ChromeDriverManager",
"random.randint"
] | [((514, 539), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (537, 539), False, 'from selenium import webdriver\n'), ((1322, 1335), 'random.randint', 'randint', (['(2)', '(7)'], {}), '(2, 7)\n', (1329, 1335), False, 'from random import randint\n'), ((595, 616), 'webdriver_manager.chrom... |
# Generated by Django 2.1.7 on 2019-06-03 05:58
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('contacts', '0003_merge_20190214_1427'),
migrations.swappable_dep... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.TimeField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
... | [((296, 353), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (327, 353), False, 'from django.db import migrations, models\n'), ((483, 576), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from django.conf.urls import url
from django.contrib import messages
from jet.dashboard import dashboard
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpRequest
from django.http import JsonResponse
from d... | [
"django.shortcuts.render",
"requests.post",
"datetime.datetime.fromtimestamp",
"json.dump",
"json.dumps",
"telegram.Bot",
"time.sleep",
"requests.get",
"json.load",
"datetime.datetime.now",
"django.shortcuts.redirect",
"pandas.DataFrame",
"threading.Thread",
"django.db.models.Q",
"yfinan... | [((803, 837), 'django.shortcuts.render', 'render', (['request', '"""admin/base.html"""'], {}), "(request, 'admin/base.html')\n", (809, 837), False, 'from django.shortcuts import render, redirect\n'), ((1982, 2012), 'pandas.to_datetime', 'pd.to_datetime', (["df['Datetime']"], {}), "(df['Datetime'])\n", (1996, 2012), Tru... |
import logging
from qbot.core import registry
from qbot.db import plugin_storage
from qbot.message import Image, OutgoingMessage, Text, send_message
from qbot.plugins.cmc import comic
PLUGIN_NAME = "xkcd"
LATEST_COMIC_KEY = "latest_comic"
logger = logging.getLogger(__name__)
@comic
async def xkcd():
last_seen_... | [
"logging.getLogger",
"qbot.core.registry.http_client.get",
"qbot.db.plugin_storage.update",
"qbot.db.plugin_storage.insert",
"qbot.message.Image",
"qbot.db.plugin_storage.select",
"qbot.message.Text"
] | [((251, 278), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (268, 278), False, 'import logging\n'), ((597, 653), 'qbot.core.registry.http_client.get', 'registry.http_client.get', (['"""https://xkcd.com/info.0.json"""'], {}), "('https://xkcd.com/info.0.json')\n", (621, 653), False, 'from ... |
"""
MIT License
Copyright (c) 2017 <NAME>
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, merge, publish, distri... | [
"logging.getLogger",
"sqlalchemy.orm.relationship",
"stocklook.config.config.get",
"json.loads",
"re.compile",
"tweepy.streaming.StreamListener.__init__",
"stocklook.utils.database.AlchemyDatabase.__init__",
"sqlalchemy.ForeignKey",
"tweepy.Stream",
"collections.Counter",
"sqlalchemy.String",
... | [((2039, 2061), 'logging.getLogger', 'lg.getLogger', (['__name__'], {}), '(__name__)\n', (2051, 2061), True, 'import logging as lg\n'), ((2191, 2224), 'stocklook.config.config.get', 'config.get', (['TWITTER_APP_KEY', 'None'], {}), '(TWITTER_APP_KEY, None)\n', (2201, 2224), False, 'from stocklook.config import TWITTER_A... |
import cv2
import threading
import queue
class Video:
def __init__(self):
"""
Default constructor.
"""
self.video = None
def __del__(self):
"""
Default destructor.
"""
if self.video:
self.video.release()
def ready(self):
... | [
"threading.Thread.__init__",
"cv2.cvtColor",
"cv2.VideoCapture",
"cv2.VideoWriter_fourcc"
] | [((1217, 1249), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.webcam_id'], {}), '(self.webcam_id)\n', (1233, 1249), False, 'import cv2\n'), ((3200, 3231), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (3225, 3231), False, 'import threading\n'), ((1294, 1336), 'cv2.VideoWriter_f... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi, sensor
from esphome.const import (
CONF_CURRENT,
CONF_ID,
CONF_POWER,
CONF_VOLTAGE,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_WATT,
DEVICE_CLASS_POWER,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_VO... | [
"esphome.config_validation.float_with_unit",
"esphome.codegen.new_Pvariable",
"esphome.codegen.get_variable",
"esphome.components.sensor.new_sensor",
"esphome.codegen.register_component",
"esphome.config_validation.Invalid",
"esphome.components.spi.spi_device_schema",
"esphome.components.spi.register_... | [((474, 508), 'esphome.codegen.esphome_ns.namespace', 'cg.esphome_ns.namespace', (['"""cs5460a"""'], {}), "('cs5460a')\n", (497, 508), True, 'import esphome.codegen as cg\n'), ((2057, 2120), 'esphome.config_validation.float_with_unit', 'cv.float_with_unit', (['"""energy"""', '"""(Wh|WH|wh)?"""'], {'optional_unit': '(Tr... |
import os
import re
import asyncio
import aiohttp
import aiofiles
import gzip
import zipfile
import bz2
import lzma
from pandas.io.common import get_filepath_or_buffer, _infer_compression
from functools import wraps
from itertools import zip_longest
from collections import AsyncIterable
def returns(*cl... | [
"asyncio.iscoroutinefunction",
"pandas.io.common._infer_compression",
"gzip.open",
"zipfile.ZipFile",
"os.path.splitext",
"os.path.join",
"functools.wraps",
"aiofiles.open",
"os.path.isfile",
"gzip.GzipFile",
"bz2.BZ2File",
"lzma.LZMAFile",
"os.path.basename",
"re.sub",
"aiohttp.parse_co... | [((1795, 1846), 'pandas.io.common._infer_compression', '_infer_compression', (['filepath_or_buffer', 'compression'], {}), '(filepath_or_buffer, compression)\n', (1813, 1846), False, 'from pandas.io.common import get_filepath_or_buffer, _infer_compression\n'), ((1889, 1954), 'pandas.io.common.get_filepath_or_buffer', 'g... |
"""
main_module - 神经网络分析统计工具类,测试是将对应方法的@unittest.skip注释掉.
Main members:
# __main__ - 程序入口.
"""
import unittest
import sys
from torch import nn
sys.path.insert(0, './') # 定义搜索路径的优先顺序,序号从0开始,表示最大优先级
import qytPytorch # noqa
print('qytPytorch module path :{}'.format(qytPytorch.__file_... | [
"torch.nn.ReLU",
"sys.path.insert",
"qytPytorch.utils.statistics_utils.get_parameter_number",
"torch.nn.Conv2d",
"torch.nn.Linear",
"unittest.main"
] | [((175, 199), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""./"""'], {}), "(0, './')\n", (190, 199), False, 'import sys\n'), ((1221, 1236), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1234, 1236), False, 'import unittest\n'), ((806, 822), 'torch.nn.Linear', 'nn.Linear', (['(2)', '(20)'], {}), '(2, 20)\n',... |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Compatibility layer for using different artifact implementations through a
# single API.
# TODO(https://crbug.com/1023458): Remove this once artifact imple... | [
"logging.warning"
] | [((2492, 2660), 'logging.warning', 'logging.warning', (['"""Only logging the first 100 characters of the given artifact. To store the full artifact, run the test in either a Telemetry or typ context."""'], {}), "(\n 'Only logging the first 100 characters of the given artifact. To store the full artifact, run the tes... |
# coding=utf-8
"""
All commands that create & use the local copies of the Google Calendar data.
"""
from __future__ import absolute_import, print_function
import requests
from icalendar import Calendar
from ..config import config, ICAL_PATH
from ..utils import nice_format
from .parser import subparsers
import six
f... | [
"icalendar.Calendar.from_ical",
"IPython.embed",
"six.moves.input",
"requests.get"
] | [((941, 976), 'requests.get', 'requests.get', (['ical_url'], {'stream': '(True)'}), '(ical_url, stream=True)\n', (953, 976), False, 'import requests\n'), ((2019, 2048), 'icalendar.Calendar.from_ical', 'Calendar.from_ical', (['ical_data'], {}), '(ical_data)\n', (2037, 2048), False, 'from icalendar import Calendar\n'), (... |
#!/usr/bin/env python3
# ========================================================================
#
# Imports
#
# ========================================================================
import os
import shutil
import argparse
import subprocess as sp
import numpy as np
import time
from datetime import timedelta
# ===... | [
"os.path.exists",
"argparse.ArgumentParser",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"os.getcwd",
"os.chdir",
"numpy.linspace",
"shutil.rmtree",
"os.path.abspath",
"datetime.timedelta",
"time.time",
"numpy.arange"
] | [((528, 539), 'time.time', 'time.time', ([], {}), '()\n', (537, 539), False, 'import time\n'), ((576, 624), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run cases"""'}), "(description='Run cases')\n", (599, 624), False, 'import argparse\n'), ((802, 822), 'numpy.arange', 'np.arange', ([... |
from django.db import models
class Person(models.Model):
person_ssn = models.IntegerField(primary_key=True,unique=True)
person_fname = models.CharField(max_length=20)
person_lname = models.CharField(max_length=50)
person_email = models.CharField(max_length=70)
person_phone = models.CharField(max_le... | [
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((75, 125), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'unique': '(True)'}), '(primary_key=True, unique=True)\n', (94, 125), False, 'from django.db import models\n'), ((144, 175), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)'}), '(max_length=20... |
import csv
from WalgreensScraper import WalgreensScraper
class WalgreensScraperWrapper():
def __init__(self):
self.WalgreensList = 'WalgreensCities.csv'
self.KeyPrefix = "Walgreens"
def MakeGetRequest(self):
with open(self.WalgreensList, mode='r') as csv_file:
csv_reader = cs... | [
"WalgreensScraper.WalgreensScraper",
"csv.reader"
] | [((318, 353), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (328, 353), False, 'import csv\n'), ((678, 746), 'WalgreensScraper.WalgreensScraper', 'WalgreensScraper', (['latitude', 'longitude', 'name', '[self.KeyPrefix + name]'], {}), '(latitude, longitude, name, [s... |
import sqlite3
class Sqlite(object):
def __init__(self, db_path):
self.db_path = db_path
def __enter__(self):
self.connect = sqlite3.connect(self.db_path)
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.connect.close()
def execute(self, *args, **kwarg... | [
"sqlite3.connect"
] | [((152, 181), 'sqlite3.connect', 'sqlite3.connect', (['self.db_path'], {}), '(self.db_path)\n', (167, 181), False, 'import sqlite3\n')] |
import logging
import os.path
class Logger(object):
def __new__(self):
my_path = os.path.abspath(os.path.dirname(__file__))
log_path = os.path.join(my_path, "../My_API/Logs/connections.log")
logger = logging.getLogger('get_item')
logger.setLevel(logging.DEBUG)
ch ... | [
"logging.getLogger",
"logging.Formatter",
"logging.FileHandler"
] | [((238, 267), 'logging.getLogger', 'logging.getLogger', (['"""get_item"""'], {}), "('get_item')\n", (255, 267), False, 'import logging\n'), ((322, 351), 'logging.FileHandler', 'logging.FileHandler', (['log_path'], {}), '(log_path)\n', (341, 351), False, 'import logging\n'), ((408, 537), 'logging.Formatter', 'logging.Fo... |
import tensorflow as tf
import input_data
import sys
def layer(input, weight_shape, bias_shape):
weight_stddev = (2.0 / weight_shape[0]) ** 0.5
w_init = tf.random_normal_initializer(stddev=weight_stddev)
bias_init = tf.constant_initializer(value=0)
W = tf.get_variable('W', weight_shape, initializer=w_i... | [
"tensorflow.get_variable",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tensorflow.Graph",
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.random_normal_initializer",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.matmul",
"tensorflow.summary.scalar",
"tensorflow.sum... | [((913, 961), 'input_data.read_data_sets', 'input_data.read_data_sets', (['"""data/"""'], {'one_hot': '(True)'}), "('data/', one_hot=True)\n", (938, 961), False, 'import input_data\n'), ((162, 212), 'tensorflow.random_normal_initializer', 'tf.random_normal_initializer', ([], {'stddev': 'weight_stddev'}), '(stddev=weigh... |
from datetime import date, timedelta
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import models
from django.views import generic
from django.core.serializers import serialize
import jsonpickle
import json
from rest_framework.renderers import JSONRenderer
from rest_framework.authtoken.model... | [
"workouttracker.models.WorkoutExercise.objects.getForWorkout",
"workouttracker.models.Run.objects.belongsTo",
"workouttracker.models.Workout.objects.belongsTo"
] | [((1000, 1061), 'workouttracker.models.WorkoutExercise.objects.getForWorkout', 'WorkoutExercise.objects.getForWorkout', (["context['lastWorkout']"], {}), "(context['lastWorkout'])\n", (1037, 1061), False, 'from workouttracker.models import Workout, WorkoutExercise, Run\n'), ((734, 778), 'workouttracker.models.Workout.o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
num = 14
sol = Solution()
res = sol.isUgly(num)
print(res)
| [
"solution.Solution"
] | [((93, 103), 'solution.Solution', 'Solution', ([], {}), '()\n', (101, 103), False, 'from solution import Solution\n')] |