code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import plotly.plotly as py
"""Get data from csv and split it"""
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for ix in alldata:
listdata.append(ix.strip().split(','))
"""Seperate data in each type of disaster."""
all_disaster = {'Drought':0, 'Flood':0, 'Storm':0, 'Epidemic':0... | [
"plotly.plotly.plot"
] | [((1028, 1107), 'plotly.plotly.plot', 'py.plot', (['make_circle'], {'filename': '"""Indonesia\'s Average Disaster from 200o to 2014"""'}), '(make_circle, filename="Indonesia\'s Average Disaster from 200o to 2014")\n', (1035, 1107), True, 'import plotly.plotly as py\n')] |
import numpy as np
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import cm
from scipy import signal
import matplotlib.image as mpimg
# matplotlib.use('Agg')
# define normalized 2D gaussian
def gaus2d(x, y, mx, my, sx, sy):
return 1. / (2. * np.pi * sx *... | [
"numpy.max",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.dot",
"numpy.meshgrid",
"matplotlib.patches.Ellipse",
"matplotlib.pyplot.show"
] | [((487, 572), 'matplotlib.patches.Ellipse', 'Ellipse', ([], {'xy': '(0, 0)', 'width': '(3.6)', 'height': '(1.8)', 'edgecolor': '"""r"""', 'lw': '(2)', 'facecolor': '"""none"""'}), "(xy=(0, 0), width=3.6, height=1.8, edgecolor='r', lw=2, facecolor='none'\n )\n", (494, 572), False, 'from matplotlib.patches import Elli... |
import requests
class BuscaEndereco:
def __init__(self,cep):
if self.valida_cep(str(cep)):
self.cep = str(cep)
else:
raise ValueError("CEP Inválido !!!")
def __str__(self):
return self.formata_cep()
def valida_cep(self,cep):
if len(self.cep ==... | [
"requests.get"
] | [((585, 602), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (597, 602), False, 'import requests\n')] |
import helpers
import sys
from representations.sequentialembedding import SequentialEmbedding
"""
Let's examine the closest neighbors for a word over time
"""
import collections
from sklearn.manifold import TSNE
import numpy as np
import matplotlib.pyplot as plt
WORDS = helpers.get_words()
if __name__ == "__main__"... | [
"helpers.savefig",
"helpers.get_words",
"helpers.fit_tsne",
"helpers.clear_figure",
"helpers.get_time_sims",
"helpers.plot_words",
"helpers.load_embeddings"
] | [((275, 294), 'helpers.get_words', 'helpers.get_words', ([], {}), '()\n', (292, 294), False, 'import helpers\n'), ((339, 364), 'helpers.load_embeddings', 'helpers.load_embeddings', ([], {}), '()\n', (362, 364), False, 'import helpers\n'), ((435, 475), 'helpers.get_time_sims', 'helpers.get_time_sims', (['embeddings', 'w... |
from __future__ import absolute_import
import six
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import serialize
from sentry.models import Project, Team
from sentry.utils.apidocs import sc... | [
"sentry.models.Team.objects.filter",
"six.text_type",
"rest_framework.response.Response",
"sentry.api.serializers.serialize",
"sentry.utils.apidocs.scenario",
"sentry.utils.apidocs.attach_scenarios",
"sentry.models.Project.objects.filter"
] | [((348, 384), 'sentry.utils.apidocs.scenario', 'scenario', (['"""ListOrganizationProjects"""'], {}), "('ListOrganizationProjects')\n", (356, 384), False, 'from sentry.utils.apidocs import scenario, attach_scenarios\n'), ((652, 707), 'sentry.utils.apidocs.attach_scenarios', 'attach_scenarios', (['[list_organization_proj... |
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.shortcuts import render
from cloudinary.models import CloudinaryField
from .utils import get_random_code
from django.template.defaultfilters import slugify
from django.contrib.auth import get_user_model... | [
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.SlugField",
"cloudinary.models.CloudinaryField",
"django.db.models.Q",
"django.db.models.CharField"
] | [((1150, 1222), 'django.db.models.OneToOneField', 'models.OneToOneField', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.CASCADE'}), '(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)\n', (1170, 1222), False, 'from django.db import models\n'), ((1242, 1296), 'django.db.models.CharField', 'models.CharField', ([... |
# -*- coding: utf-8 -*
"""
:py:class:`GenerateLabelFieldReader`
"""
import numpy as np
from senta.common.register import RegisterSet
from senta.common.rule import DataShape, FieldLength, InstanceName
from senta.data.field_reader.base_field_reader import BaseFieldReader
from senta.data.util_helper import generate_pad_... | [
"senta.data.field_reader.base_field_reader.BaseFieldReader.__init__",
"senta.data.util_helper.generate_pad_batch_data",
"numpy.reshape",
"senta.common.register.RegisterSet.tokenizer.__getitem__"
] | [((652, 709), 'senta.data.field_reader.base_field_reader.BaseFieldReader.__init__', 'BaseFieldReader.__init__', (['self'], {'field_config': 'field_config'}), '(self, field_config=field_config)\n', (676, 709), False, 'from senta.data.field_reader.base_field_reader import BaseFieldReader\n'), ((3848, 4025), 'senta.data.u... |
class Solution:
def alphabetBoardPath(self, target):
"""
Time Complexity: O(N)
Space Complexity: O(N)
"""
m = {c: [i // 5, i % 5] for i, c in enumerate("abcdefghijklmnopqrstuvwxyz")}
x0, y0 = 0, 0
res = []
for c in target:
x, y = m[c]
... | [
"json.loads",
"io.TextIOWrapper"
] | [((718, 735), 'json.loads', 'json.loads', (['input'], {}), '(input)\n', (728, 735), False, 'import json\n'), ((821, 873), 'io.TextIOWrapper', 'io.TextIOWrapper', (['sys.stdin.buffer'], {'encoding': '"""utf-8"""'}), "(sys.stdin.buffer, encoding='utf-8')\n", (837, 873), False, 'import io\n')] |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"knack.log.get_logger",
"azure.cli.core.util.sdk_no_wait"
] | [((589, 609), 'knack.log.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (599, 609), False, 'from knack.log import get_logger\n'), ((5202, 5295), 'azure.cli.core.util.sdk_no_wait', 'sdk_no_wait', (['no_wait', 'client.create_or_update', 'resource_group_name', 'virtual_hub_name', 'hub'], {}), '(no_wait, cl... |
import asyncio
from aiogram.dispatcher.middlewares import BaseMiddleware
class EnvironmentMiddleware(BaseMiddleware):
def __init__(self, context=None):
super(EnvironmentMiddleware, self).__init__()
if context is None:
context = {}
self.context = context
def update_data(s... | [
"asyncio.get_event_loop"
] | [((452, 476), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (474, 476), False, 'import asyncio\n')] |
from Dao.squad_dao import SquadDao
from Model.squad import *
from Controller.backend_controller import BackendController
from Controller.frontend_controller import FrontendController
from Controller.sgbd_controller import SgbdController
class SquadController:
dao = SquadDao()
be = BackendController()
fro =... | [
"Controller.sgbd_controller.SgbdController",
"Controller.frontend_controller.FrontendController",
"Controller.backend_controller.BackendController",
"Dao.squad_dao.SquadDao"
] | [((271, 281), 'Dao.squad_dao.SquadDao', 'SquadDao', ([], {}), '()\n', (279, 281), False, 'from Dao.squad_dao import SquadDao\n'), ((291, 310), 'Controller.backend_controller.BackendController', 'BackendController', ([], {}), '()\n', (308, 310), False, 'from Controller.backend_controller import BackendController\n'), ((... |
from django import forms
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm, PasswordChangeForm, UserChangeForm
from authapp.models import UserProfile, Status
class LoginForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for na... | [
"django.forms.HiddenInput",
"django.forms.Select"
] | [((532, 568), 'django.forms.Select', 'forms.Select', ([], {'choices': 'Status.choices'}), '(choices=Status.choices)\n', (544, 568), False, 'from django import forms\n'), ((1441, 1460), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (1458, 1460), False, 'from django import forms\n')] |
# Generated by Django 2.2.6 on 2019-11-02 17:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='item',
name='category',
field=... | [
"django.db.models.CharField"
] | [((320, 445), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'choices': "[('S', 'Shirt'), ('Sw', 'Sport wear'), ('Ow', 'Outwear')]", 'max_length': '(10)', 'null': '(True)'}), "(blank=True, choices=[('S', 'Shirt'), ('Sw', 'Sport wear'),\n ('Ow', 'Outwear')], max_length=10, null=True)\n", (... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-12-08 16:58
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('stamper', '0003_auto_20161122_1253'),
... | [
"datetime.datetime"
] | [((499, 561), 'datetime.datetime', 'datetime.datetime', (['(2016)', '(12)', '(8)', '(16)', '(57)', '(50)', '(623808)'], {'tzinfo': 'utc'}), '(2016, 12, 8, 16, 57, 50, 623808, tzinfo=utc)\n', (516, 561), False, 'import datetime\n'), ((782, 843), 'datetime.datetime', 'datetime.datetime', (['(2016)', '(12)', '(8)', '(16)'... |
import argparse,time,os,pickle
import matplotlib.pyplot as plt
import numpy as np
from player import *
plt.switch_backend('agg')
np.set_printoptions(precision=2)
class lemon:
def __init__(self, std, num_sellers, num_actions, unit, minx):
self.std = std
self.unit = unit
self.num_sellers = num_sellers
self.nu... | [
"os.path.exists",
"matplotlib.pyplot.savefig",
"pickle.dump",
"argparse.ArgumentParser",
"os.makedirs",
"matplotlib.pyplot.clf",
"pickle.load",
"numpy.asarray",
"numpy.sum",
"numpy.zeros",
"numpy.random.randn",
"matplotlib.pyplot.switch_backend",
"time.time",
"matplotlib.pyplot.subplots",
... | [((103, 128), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (121, 128), True, 'import matplotlib.pyplot as plt\n'), ((131, 163), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(2)'}), '(precision=2)\n', (150, 163), True, 'import numpy as np\n'), ((3454... |
# pylint: disable=too-many-arguments
"""
Observer implemtation doing OS command
"""
from base.iobserver import IObserver
import subprocess
import logging
import os
import sys
logging.basicConfig(
format='%(asctime)s %(levelname)s:%(name)s: %(message)s',
level=os.environ.get('LOGLEVEL', 'INFO').upper(),
d... | [
"logging.getLogger",
"os.environ.get",
"os.environ.copy"
] | [((373, 402), 'logging.getLogger', 'logging.getLogger', (['"""osaction"""'], {}), "('osaction')\n", (390, 402), False, 'import logging\n'), ((271, 305), 'os.environ.get', 'os.environ.get', (['"""LOGLEVEL"""', '"""INFO"""'], {}), "('LOGLEVEL', 'INFO')\n", (285, 305), False, 'import os\n'), ((1246, 1263), 'os.environ.cop... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017-2022 Univertity of Bristol - High Performance Networks Group
# 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.a... | [
"logging.basicConfig",
"logging.getLogger",
"sqlalchemy.orm.sessionmaker",
"json.loads",
"lib.adapters.i2cat.I2catController",
"flask.Flask",
"sqlalchemy.create_engine",
"json.dumps",
"uuid.uuid4",
"os.path.dirname",
"werkzeug.middleware.proxy_fix.ProxyFix",
"lib.adapters.ruckus.RuckusWiFi",
... | [((1504, 1668), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(levelname)s] %(funcName)s %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""', 'filename': 'log_filename', 'level': 'logging.INFO'}), "(format=\n '%(asctime)s [%(levelname)s] %(funcName)s %(message)s', datefmt=\n '%... |
import pytest
import gpmap
from epistasis import models
import numpy as np
import pandas as pd
import os
def test__genotypes_to_X(test_data):
# Make sure function catches bad genotype passes
d = test_data[0]
gpm = gpmap.GenotypePhenotypeMap(genotype=d["genotype"],
p... | [
"os.path.exists",
"gpmap.GenotypePhenotypeMap",
"numpy.ones",
"pandas.read_csv",
"numpy.unique",
"os.path.join",
"numpy.min",
"numpy.array",
"numpy.array_equal",
"pytest.raises",
"epistasis.models.base._genotypes_to_X",
"pandas.read_excel",
"pandas.DataFrame",
"epistasis.models.linear.Epis... | [((231, 307), 'gpmap.GenotypePhenotypeMap', 'gpmap.GenotypePhenotypeMap', ([], {'genotype': "d['genotype']", 'phenotype': "d['phenotype']"}), "(genotype=d['genotype'], phenotype=d['phenotype'])\n", (257, 307), False, 'import gpmap\n'), ((2639, 2680), 'epistasis.models.linear.EpistasisLinearRegression', 'models.linear.E... |
# File name: spyview.py
#
# This example should be run with "execfile('spyview.py')"
from numpy import pi, linspace, sinc, sqrt
from lib.file_support.spyview import SpyView
x_vec = linspace(-2 * pi, 2 * pi, 100)
y_vec = linspace(-2 * pi, 2 * pi, 100)
qt.mstart()
data = qt.Data(name='testmeasurement')
# to make the... | [
"numpy.sqrt",
"numpy.linspace",
"lib.file_support.spyview.SpyView"
] | [((183, 213), 'numpy.linspace', 'linspace', (['(-2 * pi)', '(2 * pi)', '(100)'], {}), '(-2 * pi, 2 * pi, 100)\n', (191, 213), False, 'from numpy import pi, linspace, sinc, sqrt\n'), ((222, 252), 'numpy.linspace', 'linspace', (['(-2 * pi)', '(2 * pi)', '(100)'], {}), '(-2 * pi, 2 * pi, 100)\n', (230, 252), False, 'from ... |
#! /usr/bin/env python3
"""
alibExp
=======================
Qt4 interface for alib explorer
To browse alib in a more user-friendly way than simple text
Item.data(1,-1) stores its data, i.e. a str or another alib
"""
# NOTE: the actual command documentation is collected from docstrings of the
# commands and is appen... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"time.sleep",
"WalArt.gui.QtGui4or5.QtGuiFinder",
"WalArt.waFile.Join",
"WalArt.waFile.Find",
"WalArt.alib",
"WalArt.waText.Brief",
"PyQt5.QtCore.QSize"
] | [((1364, 1377), 'WalArt.gui.QtGui4or5.QtGuiFinder', 'QtGuiFinder', ([], {}), '()\n', (1375, 1377), False, 'from WalArt.gui.QtGui4or5 import QtGuiFinder\n'), ((2062, 2084), 'WalArt.waFile.Find', 'waFile.Find', (['"""add.png"""'], {}), "('add.png')\n", (2073, 2084), False, 'from WalArt import waFile, waText\n'), ((2136, ... |
"""
Integration test for the Luigi wrapper of AWS Batch
Requires:
- boto3 package
- Amazon AWS credentials discoverable by boto3 (e.g., by using ``aws configure``
from awscli_)
- An enabled AWS Batch job queue configured to run on a compute environment.
Written and maintained by <NAME> (@jfeala) for Outlier Bio (@ou... | [
"ob_pipelines.batch.client.register_job_definition",
"ob_pipelines.batch._get_job_status",
"unittest.SkipTest"
] | [((477, 546), 'unittest.SkipTest', 'unittest.SkipTest', (['"""boto3 is not installed. BatchTasks require boto3"""'], {}), "('boto3 is not installed. BatchTasks require boto3')\n", (494, 546), False, 'import unittest\n'), ((1541, 1587), 'ob_pipelines.batch.client.register_job_definition', 'client.register_job_definition... |
import os
import uuid
import logging
import json
from json import JSONEncoder
from pythonjsonlogger import jsonlogger
from datetime import datetime
from logging.config import dictConfig
# Custom JSON encoder which enforce standard ISO 8601 format, UUID format
class ModelJsonEncoder(JSONEncoder):
def default(self,... | [
"logging.config.dictConfig",
"json.JSONEncoder.default",
"datetime.datetime.utcnow"
] | [((1569, 2085), 'logging.config.dictConfig', 'dictConfig', (["{'version': 1, 'formatters': {'default': {'()': JsonLogFormatter, 'format':\n '%(timestamp)s %(level)s %(service)s %(instance)s %(type)s %(message)s',\n 'json_encoder': ModelJsonEncoder}}, 'filters': {'default': {'()':\n LogFilter, 'service': servic... |
#!/usr/bin/env python
import collections
from pathlib import Path
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import vtkLookupT... | [
"vtkmodules.vtkInteractionWidgets.vtkOrientationMarkerWidget",
"vtkmodules.vtkCommonTransforms.vtkTransform",
"vtkmodules.vtkFiltersCore.vtkContourFilter",
"vtkmodules.vtkFiltersCore.vtkStripper",
"vtkmodules.vtkRenderingCore.vtkRenderWindow",
"vtkmodules.vtkIOImage.vtkMetaImageReader",
"vtkmodules.vtkI... | [((2219, 2342), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description', 'epilog': 'epilogue', 'formatter_class': 'argparse.RawDescriptionHelpFormatter'}), '(description=description, epilog=epilogue,\n formatter_class=argparse.RawDescriptionHelpFormatter)\n', (2242, 2342), False, 'im... |
# Author ProGramMoS, <NAME>
# Version 0.2b
import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gam... | [
"com.l2jfrozen.gameserver.model.quest.State",
"com.l2jfrozen.gameserver.model.quest.jython.QuestJython.__init__"
] | [((981, 1002), 'com.l2jfrozen.gameserver.model.quest.State', 'State', (['"""Start"""', 'QUEST'], {}), "('Start', QUEST)\n", (986, 1002), False, 'from com.l2jfrozen.gameserver.model.quest import State\n'), ((1013, 1036), 'com.l2jfrozen.gameserver.model.quest.State', 'State', (['"""Started"""', 'QUEST'], {}), "('Started'... |
# Pyspark example called by mlrun_spark_k8s.ipynb
from pyspark.sql import SparkSession
from mlrun import get_or_create_ctx
# Acquire MLRun context
mlctx = get_or_create_ctx("spark-function")
# Get MLRun parameters
mlctx.logger.info("!@!@!@!@!@ Getting env variables")
READ_OPTIONS = mlctx.get_param("data_sources")
... | [
"mlrun.get_or_create_ctx",
"pyspark.sql.SparkSession.builder.appName"
] | [((159, 194), 'mlrun.get_or_create_ctx', 'get_or_create_ctx', (['"""spark-function"""'], {}), "('spark-function')\n", (176, 194), False, 'from mlrun import get_or_create_ctx\n'), ((434, 480), 'pyspark.sql.SparkSession.builder.appName', 'SparkSession.builder.appName', (['"""Spark function"""'], {}), "('Spark function')\... |
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import numpy as np
import h5py
import copy
import time
import os
from whacc import utils
def isnotebook():
try:
c = str(get_ipython().__class__)
shell = get_ipython().__class__.__name__
if 'colab' in c:
... | [
"whacc.utils.make_list",
"matplotlib.pyplot.grid",
"numpy.hstack",
"time.sleep",
"numpy.array",
"whacc.utils.loop_segments",
"tensorflow.keras.models.load_model",
"copy.deepcopy",
"tensorflow.cast",
"os.remove",
"matplotlib.pyplot.imshow",
"numpy.mean",
"numpy.repeat",
"numpy.where",
"nu... | [((950, 979), 'whacc.utils.loop_segments', 'utils.loop_segments', (['frames_1'], {}), '(frames_1)\n', (969, 979), False, 'from whacc import utils\n'), ((1494, 1517), 'numpy.asarray', 'np.asarray', (['array_group'], {}), '(array_group)\n', (1504, 1517), True, 'import numpy as np\n'), ((1989, 2036), 'whacc.utils.make_lis... |
import pandas as pd
import os
import random
train_df = pd.read_csv("./data/Train_DataSet.csv")
train_label_df = pd.read_csv("./data/Train_DataSet_Label.csv")
test_df = pd.read_csv("./data/Test_DataSet.csv")
train_df = train_df.merge(train_label_df, on='id', how='left')
train_df['label'] = train_df['label'].fillna(-1)
... | [
"pandas.read_csv"
] | [((56, 95), 'pandas.read_csv', 'pd.read_csv', (['"""./data/Train_DataSet.csv"""'], {}), "('./data/Train_DataSet.csv')\n", (67, 95), True, 'import pandas as pd\n'), ((113, 158), 'pandas.read_csv', 'pd.read_csv', (['"""./data/Train_DataSet_Label.csv"""'], {}), "('./data/Train_DataSet_Label.csv')\n", (124, 158), True, 'im... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | [
"itertools.cycle",
"nicos.core.errors.SPMError",
"re.compile"
] | [((1867, 1904), 're.compile', 're.compile', (['"""[a-zA-Z_][a-zA-Z0-9_]*$"""'], {}), "('[a-zA-Z_][a-zA-Z0-9_]*$')\n", (1877, 1904), False, 'import re\n'), ((1918, 1956), 're.compile', 're.compile', (['"""\'(\\\\\\\\\\\\\\\\|\\\\\\\\\'|[^\'])*\'"""'], {}), '("\'(\\\\\\\\\\\\\\\\|\\\\\\\\\'|[^\'])*\'")\n', (1928, 1956), ... |
import numpy as np
import apm_id as arx
######################################################
# Configuration
######################################################
# number of terms
ny = 2 # output coefficients
nu = 1 # input coefficients
# number of inputs
ni = 1
# number of outputs
no = 1
# load data ... | [
"numpy.loadtxt",
"apm_id.apm_id"
] | [((351, 398), 'numpy.loadtxt', 'np.loadtxt', (['"""data_step_test.csv"""'], {'delimiter': '""","""'}), "('data_step_test.csv', delimiter=',')\n", (361, 398), True, 'import numpy as np\n'), ((487, 515), 'apm_id.apm_id', 'arx.apm_id', (['data', 'ni', 'nu', 'ny'], {}), '(data, ni, nu, ny)\n', (497, 515), True, 'import apm... |
#!/usr/bin/env python
'''
setup
=====
This is a relatively complicated setup script, since
it does a few things to simplify version control
and configuration files.
There's a simple script that overrides the `build_py`
command to ensure there's proper version control set
for the librar... | [
"enum.auto",
"re.compile",
"distutils.command.build_py.build_py.run",
"sys.exit",
"os.remove",
"os.path.exists",
"textwrap.dedent",
"os.chmod",
"subprocess.call",
"os.to_triple",
"glob.glob",
"subprocess.check_call",
"shutil.which",
"setuptools.setup",
"re.match",
"ast.literal_eval",
... | [((1991, 2005), 'os.chdir', 'os.chdir', (['HOME'], {}), '(HOME)\n', (1999, 2005), False, 'import os\n'), ((74118, 75424), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""xcross"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'version': 'version', 'packages': "['xcross']", 'description': 'descr... |
from typing import Any
from unittest import TestCase
from unittest.mock import patch, MagicMock
import yaml
from github import GithubException
from reconcile.utils.openshift_resource import ResourceInventory
from reconcile.utils.saasherder import SaasHerder
from reconcile.utils.jjb_client import JJB
from reconcile.ut... | [
"reconcile.utils.openshift_resource.ResourceInventory",
"reconcile.utils.saasherder.SaasHerder.remove_none_values",
"reconcile.utils.saasherder.SaasHerder",
"reconcile.utils.jjb_client.JJB.get_ref",
"unittest.mock.MagicMock",
"reconcile.utils.jjb_client.JJB.get_repo_url",
"yaml.safe_load",
"github.Git... | [((591, 612), 'reconcile.utils.jjb_client.JJB.get_repo_url', 'JJB.get_repo_url', (['job'], {}), '(job)\n', (607, 612), False, 'from reconcile.utils.jjb_client import JJB\n'), ((669, 685), 'reconcile.utils.jjb_client.JJB.get_ref', 'JJB.get_ref', (['job'], {}), '(job)\n', (680, 685), False, 'from reconcile.utils.jjb_clie... |
import unittest
import time
import copy
from unittest.mock import patch, MagicMock, call
from ignition.service.messaging import PostalService, KafkaDeliveryService, KafkaInboxService, Envelope, Message, MessagingProperties
from kafka import KafkaProducer
class TestPostalService(unittest.TestCase):
def setUp(self... | [
"ignition.service.messaging.KafkaDeliveryService",
"ignition.service.messaging.KafkaInboxService",
"ignition.service.messaging.MessagingProperties",
"unittest.mock.MagicMock",
"ignition.service.messaging.PostalService",
"unittest.mock.call",
"time.sleep",
"ignition.service.messaging.Message",
"copy.... | [((2218, 2267), 'unittest.mock.patch', 'patch', (['"""ignition.service.messaging.KafkaProducer"""'], {}), "('ignition.service.messaging.KafkaProducer')\n", (2223, 2267), False, 'from unittest.mock import patch, MagicMock, call\n'), ((3088, 3137), 'unittest.mock.patch', 'patch', (['"""ignition.service.messaging.KafkaPro... |
import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
# This is bullshit! Problem was not solved!
# The first connection is successful, but after that postgres closes the connection and
# reconnects. At the moment, this script h... | [
"time.sleep"
] | [((666, 679), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (676, 679), False, 'import time\n'), ((931, 944), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (941, 944), False, 'import time\n')] |
#!/usr/bin/env python
# Copyright 2017 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
#
# Unle... | [
"tensorflow.shape",
"tensorflow.logging.set_verbosity",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.string_split",
"tensorflow.estimator.export.PredictOutput",
"tensorflow.ones_like",
"tensorflow.estimator.LatestExporter",
"tensorflow.estimator.train_and_evaluate",
"tensorflow.placeholder",
... | [((747, 788), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (771, 788), True, 'import tensorflow as tf\n'), ((5278, 5350), 'tensorflow.concat', 'tf.concat', ([], {'values': "[features['mean_rgb'], features['mean_audio']]", 'axis': '(1)'}), "(values=[fe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Open and modify Microsoft Word 2007 docx files (called 'OpenXML' and 'Office OpenXML' by Microsoft)
Part of Python's docx module - http://github.com/mikemaccana/python-docx
See LICENSE for licensing information.
'''
from copy import deepcopy
import logging
from lxml i... | [
"logging.getLogger",
"lxml.etree.Element",
"zipfile.ZipFile",
"re.compile",
"os.makedirs",
"time.strftime",
"os.path.join",
"os.chdir",
"os.path.dirname",
"Image.open",
"os.path.isdir",
"lxml.etree.fromstring",
"copy.deepcopy",
"os.path.abspath",
"re.sub",
"os.walk",
"lxml.etree.tost... | [((519, 546), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (536, 546), False, 'import logging\n'), ((715, 740), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (730, 740), False, 'import os\n'), ((778, 805), 'os.path.isdir', 'os.path.isdir', (['TEMPLATE_DIR'], ... |
# Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"tortuga.objects.tortugaObject.TortugaObjectList",
"functools.cmp_to_key"
] | [((1457, 1476), 'tortuga.objects.tortugaObject.TortugaObjectList', 'TortugaObjectList', ([], {}), '()\n', (1474, 1476), False, 'from tortuga.objects.tortugaObject import TortugaObject, TortugaObjectList\n'), ((1508, 1527), 'tortuga.objects.tortugaObject.TortugaObjectList', 'TortugaObjectList', ([], {}), '()\n', (1525, ... |
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin
from django.db import models
from django.utils import timezone
from django.db.models import BooleanField
class UserManager(BaseUserManager):
def _create_user(self, email, password, usertype, is_staff, is_superuser, **ext... | [
"django.db.models.EmailField",
"django.db.models.BooleanField",
"django.utils.timezone.now",
"django.db.models.DateTimeField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.CharField"
] | [((1785, 1831), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(254)', 'unique': '(True)'}), '(max_length=254, unique=True)\n', (1802, 1831), False, 'from django.db import models\n'), ((1843, 1898), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(254)', 'null': '(True)'... |
import iota_client
client = iota_client.Client()
print(
client.get_output("a22cba0667c922cbb1f8bdcaf970b2a881ccd6e88e2fcce50374de2aac7c37720000")
) | [
"iota_client.Client"
] | [((28, 48), 'iota_client.Client', 'iota_client.Client', ([], {}), '()\n', (46, 48), False, 'import iota_client\n')] |
import sys
sys.path.insert(0, "Modelos/Mapa")
from Map import *
from Item import Item
"""
Define a classe que manipula a logica do jogo.
"""
class Game:
"""
Define um jogador do jogo.
"""
class Player:
"""
Cria uma nova instancia de jogador
"""
def __init__(self, name, addr, map):
self.Name = name
... | [
"Item.Item",
"sys.path.insert"
] | [((11, 45), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""Modelos/Mapa"""'], {}), "(0, 'Modelos/Mapa')\n", (26, 45), False, 'import sys\n'), ((445, 462), 'Item.Item', 'Item', (['"""Mapa"""', 'map'], {}), "('Mapa', map)\n", (449, 462), False, 'from Item import Item\n'), ((3737, 3794), 'Item.Item', 'Item', (['objeto... |
from datetime import datetime
{
datetime(2019, 12, 30, 0, 0): 35,
datetime(2020, 1, 6, 0, 0): 27,
datetime(2020, 1, 13, 0, 0): 39,
datetime(2020, 1, 20, 0, 0): 120,
datetime(2020, 1, 27, 0, 0): 73,
datetime(2020, 2, 3, 0, 0): 48,
datetime(2020, 2, 10, 0, 0): 35,
datetime(2020, 2, 17, 0,... | [
"datetime.datetime"
] | [((37, 65), 'datetime.datetime', 'datetime', (['(2019)', '(12)', '(30)', '(0)', '(0)'], {}), '(2019, 12, 30, 0, 0)\n', (45, 65), False, 'from datetime import datetime\n'), ((75, 101), 'datetime.datetime', 'datetime', (['(2020)', '(1)', '(6)', '(0)', '(0)'], {}), '(2020, 1, 6, 0, 0)\n', (83, 101), False, 'from datetime ... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
"alembic.op.get_bind",
"sqlalchemy.text"
] | [((1517, 1530), 'alembic.op.get_bind', 'op.get_bind', ([], {}), '()\n', (1528, 1530), False, 'from alembic import op\n'), ((1548, 3035), 'sqlalchemy.text', 'sa.text', (['"""\n UPDATE db_dbnode\n SET attributes = jsonb_set(attributes, \'{"sealed"}\', attributes->\'_sealed\')\n WHERE attributes ? \'_... |
# stub to allow changing the map without having to alter gta_model.sc
import os
mapPath = 'map.npz'
def setLocalMap(module, relpath):
global mapPath
base = os.path.dirname(module)
mapPath = os.path.join(base, relpath)
| [
"os.path.dirname",
"os.path.join"
] | [((168, 191), 'os.path.dirname', 'os.path.dirname', (['module'], {}), '(module)\n', (183, 191), False, 'import os\n'), ((206, 233), 'os.path.join', 'os.path.join', (['base', 'relpath'], {}), '(base, relpath)\n', (218, 233), False, 'import os\n')] |
"""Module exposing the `Matrices` and `MatricesMetric` class."""
from functools import reduce
import geomstats.backend as gs
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.riemannian_metric import RiemannianMetric
TOLERANCE = 1e-5
class Matrices(Euclidean):
"""Class for the space o... | [
"geomstats.backend.random.rand",
"geomstats.backend.to_ndarray",
"functools.reduce",
"geomstats.backend.einsum",
"geomstats.backend.array",
"geomstats.backend.isclose",
"geomstats.backend.transpose"
] | [((735, 766), 'geomstats.backend.to_ndarray', 'gs.to_ndarray', (['point'], {'to_ndim': '(3)'}), '(point, to_ndim=3)\n', (748, 766), True, 'import geomstats.backend as gs\n'), ((1907, 1930), 'functools.reduce', 'reduce', (['gs.matmul', 'args'], {}), '(gs.matmul, args)\n', (1913, 1930), False, 'from functools import redu... |
import gpsd
import json
import logging
import socket
import httpx
import paho.mqtt.client as mqtt
class MQTTReporter:
def __init__(self, name, mqtt_server=None, gps_server=None, compass=False):
self.name = name
self.mqtt_server = mqtt_server
self.compass = compass
self.gps_server... | [
"paho.mqtt.client.Client",
"gpsd.connect",
"json.dumps",
"httpx.get",
"gpsd.get_current",
"logging.info",
"logging.error"
] | [((428, 477), 'logging.info', 'logging.info', (['f"""connecting to {self.mqtt_server}"""'], {}), "(f'connecting to {self.mqtt_server}')\n", (440, 477), False, 'import logging\n'), ((499, 512), 'paho.mqtt.client.Client', 'mqtt.Client', ([], {}), '()\n', (510, 512), True, 'import paho.mqtt.client as mqtt\n'), ((630, 675)... |
import os, sys, time, shutil, argparse
from functools import partial
import pickle
sys.path.append('../')
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import datasets, transforms
#import torchvision.models as models
import torch.optim as optim
import torch.nn.parallel
import t... | [
"argparse.ArgumentParser",
"captioning.utils.opts.add_eval_options",
"captioning.utils.misc.pickle_load",
"torch.load",
"onnxruntime.InferenceSession",
"torch.randn",
"captioning.models.setup",
"torch.randint",
"torch.cuda.is_available",
"sys.path.append",
"captioning.utils.opts.add_diversity_op... | [((83, 105), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (98, 105), False, 'import os, sys, time, shutil, argparse\n'), ((1188, 1213), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1211, 1213), False, 'import torch\n'), ((1678, 1703), 'argparse.ArgumentParser', 'ar... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-27 14:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | [
"django.db.models.FloatField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((7170, 7231), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""phenotypedb.PhenotypeMetaDynamic"""'}), "(to='phenotypedb.PhenotypeMetaDynamic')\n", (7192, 7231), False, 'from django.db import migrations, models\n'), ((7355, 7500), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {... |
from release_libraries import LibraryParameters
from bam_finder import getBamPath, library_default_dir, MT_default_dir, ShopVersion
import argparse
import re
from has_read_groups import read_group_checks
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Augment the bam list for a release with a... | [
"has_read_groups.read_group_checks",
"argparse.ArgumentParser",
"bam_finder.ShopVersion",
"bam_finder.getBamPath",
"release_libraries.LibraryParameters",
"re.search"
] | [((242, 370), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Augment the bam list for a release with a prior existing version of the library"""'}), "(description=\n 'Augment the bam list for a release with a prior existing version of the library'\n )\n", (265, 370), False, 'import ... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as signal
plt.ion()
bands = [2,3]
single_channel_readout = 2
nsamp = 2**25
new_chans = False
def etaPhaseModDegree(etaPhase):
return (etaPhase+180)%360-180
#For resonator I/Q high sampled data use eta_mag + eta_phase found in eta scans for Q... | [
"scipy.signal.welch",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"numpy.round",
"matplotlib.pyplot.xlabel",
"numpy.asarray",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((81, 90), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (88, 90), True, 'import matplotlib.pyplot as plt\n'), ((1465, 1488), 'numpy.asarray', 'np.asarray', (['freqs[band]'], {}), '(freqs[band])\n', (1475, 1488), True, 'import numpy as np\n'), ((1509, 1530), 'numpy.asarray', 'np.asarray', (['sbs[band]'], {}), ... |
from typing import List, Tuple
import numpy as np
import pymeshfix
import trimesh.voxel.creation
from skimage.measure import marching_cubes
from trimesh import Trimesh
from trimesh.smoothing import filter_taubin
from ..types import BinaryImage, LabelImage
def _round_to_pitch(coordinate: np.ndarray, pitch: float) ->... | [
"numpy.mean",
"numpy.ceil",
"numpy.asarray",
"numpy.min",
"numpy.max",
"numpy.array",
"numpy.zeros",
"trimesh.smoothing.filter_taubin",
"numpy.argwhere",
"trimesh.Trimesh",
"skimage.measure.marching_cubes",
"numpy.concatenate",
"pymeshfix.clean_from_arrays",
"numpy.round"
] | [((994, 1019), 'numpy.asarray', 'np.asarray', (['mesh.vertices'], {}), '(mesh.vertices)\n', (1004, 1019), True, 'import numpy as np\n'), ((1032, 1054), 'numpy.asarray', 'np.asarray', (['mesh.faces'], {}), '(mesh.faces)\n', (1042, 1054), True, 'import numpy as np\n'), ((1090, 1134), 'pymeshfix.clean_from_arrays', 'pymes... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file : sst_dataset.py
@author: zijun
@contact : <EMAIL>
@date : 2020/11/17 11:45
@version: 1.0
@desc : sst5 and imdb task use the same dataset
"""
import os
from functools import partial
import torch
from transformers import RobertaTokenizer
from torch.utils.data i... | [
"transformers.RobertaTokenizer.from_pretrained",
"torch.LongTensor",
"functools.partial",
"os.path.join"
] | [((765, 808), 'transformers.RobertaTokenizer.from_pretrained', 'RobertaTokenizer.from_pretrained', (['bert_path'], {}), '(bert_path)\n', (797, 808), False, 'from transformers import RobertaTokenizer\n'), ((1393, 1432), 'torch.LongTensor', 'torch.LongTensor', (['([0] + input_ids + [2])'], {}), '([0] + input_ids + [2])\n... |
# Copyright (c) 2021 The University of Texas at Austin
# 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 condi... | [
"gem5.utils.requires.requires",
"gem5.components.cachehierarchies.ruby.mi_example_cache_hierarchy.MIExampleCacheHierarchy",
"m5.disableAllListeners",
"sys.exit",
"textwrap.dedent",
"argparse.ArgumentParser",
"m5.curTick",
"gem5.components.boards.x86_board.X86Board",
"gem5.runtime.get_runtime_coheren... | [((2546, 2639), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A script to test forking gem5 and switching cpus."""'}), "(description=\n 'A script to test forking gem5 and switching cpus.')\n", (2569, 2639), False, 'import argparse\n'), ((3978, 4102), 'gem5.utils.requires.requires', '... |
# -*- coding: utf-8 -*-
import os
import timeit
import xarray
import rioxarray
import pandas as pd
wd = os.getcwd()
catalog = os.path.join('data', 'LC08_L1TP_190024_20200418_20200822_02_T1')
rasters = os.listdir(catalog)
rasters = [r for r in rasters if r.endswith(('.TIF'))]
rasters = [os.path.join(wd, ca... | [
"rioxarray.open_rasterio",
"os.listdir",
"timeit.default_timer",
"os.path.join",
"pandas.DataFrame.from_dict",
"os.getcwd",
"xarray.concat",
"os.path.isdir",
"os.mkdir",
"os.remove"
] | [((114, 125), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (123, 125), False, 'import os\n'), ((137, 201), 'os.path.join', 'os.path.join', (['"""data"""', '"""LC08_L1TP_190024_20200418_20200822_02_T1"""'], {}), "('data', 'LC08_L1TP_190024_20200418_20200822_02_T1')\n", (149, 201), False, 'import os\n'), ((213, 232), 'os.... |
''' Miscellaneous internal utilities. '''
import collections
import os
from abc import ABCMeta, abstractmethod, abstractproperty
from types import GeneratorType
from itertools import islice
from tqdm import tqdm
import pandas as pd
from pliers import config
from pliers.support.exceptions import MissingDependencyErro... | [
"itertools.islice",
"collections.namedtuple",
"tqdm.tqdm",
"pliers.support.exceptions.MissingDependencyError",
"pliers.config.get_option"
] | [((3248, 3301), 'collections.namedtuple', 'collections.namedtuple', (['"""Dependency"""', '"""package value"""'], {}), "('Dependency', 'package value')\n", (3270, 3301), False, 'import collections\n'), ((2023, 2058), 'pliers.config.get_option', 'config.get_option', (['"""use_generators"""'], {}), "('use_generators')\n"... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | [
"functools.lru_cache",
"numpy.concatenate"
] | [((1271, 1304), 'functools.lru_cache', 'functools.lru_cache', ([], {'maxsize': 'None'}), '(maxsize=None)\n', (1290, 1304), False, 'import functools\n'), ((1585, 1615), 'numpy.concatenate', 'np.concatenate', (['images'], {'axis': '(0)'}), '(images, axis=0)\n', (1599, 1615), True, 'import numpy as np\n'), ((1687, 1717), ... |
import inspect
import functools
from gridengine import job, dispatch, schedulers
# ----------------------------------------------------------------------------
# Partial
# ----------------------------------------------------------------------------
def isexception(x):
"""Test whether the value is an Exception instan... | [
"gridengine.job.Job",
"gridengine.dispatch.JobDispatcher",
"functools.partial"
] | [((1166, 1203), 'functools.partial', 'functools.partial', (['f', '*args'], {}), '(f, *args, **kwargs)\n', (1183, 1203), False, 'import functools\n'), ((2712, 2745), 'gridengine.dispatch.JobDispatcher', 'dispatch.JobDispatcher', (['scheduler'], {}), '(scheduler)\n', (2734, 2745), False, 'from gridengine import job, disp... |
#!/usr/bin/env python
#
# Video pupilometry functions
# - takes calibration and gaze video filenames as input
# - controls calibration and gaze estimation workflow
#
# USAGE : mrgaze.py <Calibration Video> <Gaze Video>
#
# AUTHOR : <NAME>
# PLACE : Caltech
# DATES : 2014-05-07 JMT From scratch
# 2016-02-22 J... | [
"mrgaze.media.Preproc",
"mrgaze.calibrate.AutoCalibrate",
"mrgaze.engine.PupilometryPars",
"cv2.destroyAllWindows",
"getpass.getuser",
"cv2.CascadeClassifier",
"mrgaze.media.LoadVideoFrame",
"mrgaze.config.LoadConfig",
"cv2.VideoWriter",
"os.path.isdir",
"cv2.VideoWriter_fourcc",
"mrgaze.utils... | [((2006, 2033), 'mrgaze.config.LoadConfig', 'config.LoadConfig', (['data_dir'], {}), '(data_dir)\n', (2023, 2033), False, 'from mrgaze import media, utils, config, calibrate, report, engine\n'), ((2047, 2058), 'time.time', 'time.time', ([], {}), '()\n', (2056, 2058), False, 'import time\n'), ((2431, 2461), 'os.path.joi... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author : Alenx.Hai <<EMAIL>>
# created time: 2020/12/21-10:49 上午
import asyncio
from src.mysql_elastic import MySQLElasticSearch
@asyncio.coroutine
def main():
elastic = MySQLElasticSearch()
yield elastic.put_data()
if __name__ == '__main__':
loop = asynci... | [
"asyncio.get_event_loop",
"src.mysql_elastic.MySQLElasticSearch"
] | [((224, 244), 'src.mysql_elastic.MySQLElasticSearch', 'MySQLElasticSearch', ([], {}), '()\n', (242, 244), False, 'from src.mysql_elastic import MySQLElasticSearch\n'), ((314, 338), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (336, 338), False, 'import asyncio\n')] |
# Crie um módulo chamado moeda.py que tenha as funções incorporadas aumentar(), diminuir(), dobro() e metade(). Faça
# também um programa que importe esse módulo e use algumas dessas funções.
import moeda
p = float(input('Digite o preço: '))
print(f'A metade do {p} é R${moeda.metade(p)}')
print(f'O dobro de {p} é R${... | [
"moeda.aumentar",
"moeda.metade",
"moeda.dobro"
] | [((274, 289), 'moeda.metade', 'moeda.metade', (['p'], {}), '(p)\n', (286, 289), False, 'import moeda\n'), ((321, 335), 'moeda.dobro', 'moeda.dobro', (['p'], {}), '(p)\n', (332, 335), False, 'import moeda\n'), ((371, 392), 'moeda.aumentar', 'moeda.aumentar', (['p', '(10)'], {}), '(p, 10)\n', (385, 392), False, 'import m... |
"""Class to hold all cover accessories."""
import logging
from homeassistant.components.cover import ATTR_CURRENT_POSITION
from homeassistant.helpers.event import async_track_state_change
from . import TYPES
from .accessories import HomeAccessory, add_preload_service
from .const import (
SERV_WINDOW_COVERING, CHA... | [
"logging.getLogger",
"homeassistant.helpers.event.async_track_state_change"
] | [((399, 426), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (416, 426), False, 'import logging\n'), ((1574, 1660), 'homeassistant.helpers.event.async_track_state_change', 'async_track_state_change', (['self._hass', 'self._entity_id', 'self.update_cover_position'], {}), '(self._hass, self... |
import unittest
from yapper import create_app, db
from yapper.blueprints.user.models import User, Role
class TestUserAddToDb(unittest.TestCase):
def setUp(self):
self.app = create_app('test')
self.app_context = self.app.app_context()
self.app_context.push()
db.create_all()
def... | [
"yapper.db.drop_all",
"yapper.create_app",
"yapper.db.session.add",
"yapper.db.session.remove",
"yapper.blueprints.user.models.Role",
"yapper.db.create_all",
"yapper.db.session.commit",
"yapper.blueprints.user.models.User"
] | [((187, 205), 'yapper.create_app', 'create_app', (['"""test"""'], {}), "('test')\n", (197, 205), False, 'from yapper import create_app, db\n'), ((296, 311), 'yapper.db.create_all', 'db.create_all', ([], {}), '()\n', (309, 311), False, 'from yapper import create_app, db\n'), ((345, 364), 'yapper.db.session.remove', 'db.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from bibdeskparser.customization import InvalidName, splitname
class TestSplitnameMethod(unittest.TestCase):
def test_splitname_basic(self):
"""Basic tests of customization.splitname() """
# Empty input.
result = splitname("")... | [
"unittest.main",
"bibdeskparser.customization.splitname"
] | [((28218, 28233), 'unittest.main', 'unittest.main', ([], {}), '()\n', (28231, 28233), False, 'import unittest\n'), ((307, 320), 'bibdeskparser.customization.splitname', 'splitname', (['""""""'], {}), "('')\n", (316, 320), False, 'from bibdeskparser.customization import InvalidName, splitname\n'), ((473, 490), 'bibdeskp... |
import re
import logging
logger = logging.getLogger(__name__)
def get_sorted_pair(a, b):
# ensure citation pair is always in same order
if a > b:
return (a, b)
else:
return (b, a)
def to_label(t, labels):
if t in labels:
return t
else:
return 'other'
def normal... | [
"logging.getLogger"
] | [((35, 62), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (52, 62), False, 'import logging\n')] |
bl_info = {
"name": "Import Fromsoft FLVER models",
"description":
"Import models from various Fromsoft games such as Dark Souls",
"author": "<NAME>",
"version": (0, 1, 0),
"blender": (2, 80, 0),
"category": "Import-Export",
"location": "File > Import",
"warning": "",
"... | [
"bpy.utils.unregister_class",
"bpy.props.BoolProperty",
"bpy.props.StringProperty",
"bpy.types.TOPBAR_MT_file_import.remove",
"bpy.types.TOPBAR_MT_file_import.append",
"bpy.utils.register_class"
] | [((994, 1047), 'bpy.props.StringProperty', 'StringProperty', ([], {'default': '"""*.flver"""', 'options': "{'HIDDEN'}"}), "(default='*.flver', options={'HIDDEN'})\n", (1008, 1047), False, 'from bpy.props import StringProperty, BoolProperty\n'), ((1075, 1238), 'bpy.props.BoolProperty', 'BoolProperty', ([], {'name': '"""... |
# -*- coding: utf-8 -*-
# https://github.com/Kodi-vStream/venom-xbmc-addons
from resources.lib.gui.contextElement import cContextElement
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.db import cDb
from resources.lib.handler.outputParameterHandler import cOutputParameterHandler
from resources.l... | [
"resources.lib.comaddon.addon",
"resources.lib.comaddon.window",
"resources.lib.comaddon.isKrypton",
"resources.lib.gui.guiElement.cGuiElement",
"resources.lib.comaddon.dialog",
"copy.deepcopy",
"resources.lib.ba.cShowBA",
"resources.lib.comaddon.xbmc.Keyboard",
"xbmcplugin.setContent",
"resources... | [((773, 780), 'resources.lib.comaddon.addon', 'addon', ([], {}), '()\n', (778, 780), False, 'from resources.lib.comaddon import listitem, addon, dialog, isKrypton, window, xbmc\n'), ((789, 800), 'resources.lib.comaddon.isKrypton', 'isKrypton', ([], {}), '()\n', (798, 800), False, 'from resources.lib.comaddon import lis... |
#!/usr/bin/env python3
__copyright__ = 'Copyright 2013-2016, http://radical.rutgers.edu'
__license__ = 'MIT'
import sys
import radical.utils as ru
import radical.pilot as rp
rpu = rp.utils
# ------------------------------------------------------------------------------
#
if __name__ == '__main__':
if len(sy... | [
"radical.utils.combine_profiles",
"radical.utils.read_profiles",
"sys.exit"
] | [((541, 567), 'radical.utils.read_profiles', 'ru.read_profiles', (['profiles'], {}), '(profiles)\n', (557, 567), True, 'import radical.utils as ru\n'), ((624, 650), 'radical.utils.combine_profiles', 'ru.combine_profiles', (['profs'], {}), '(profs)\n', (643, 650), True, 'import radical.utils as ru\n'), ((388, 399), 'sys... |
#!/usr/bin/env python3.6
from user import User
from credential import Credential
def createUser(userName,password):
'''
Function to create a new user
'''
newUser = User(userName,password)
return newUser
def saveUsers(user):
'''
Function to save users
'''
user.saveUser()
def crea... | [
"credential.Credential",
"credential.Credential.find_by_name",
"credential.Credential.deleteCredential",
"credential.Credential.saveCredential",
"credential.Credential.displayCredentials",
"credential.Credential.credential_exist",
"user.User"
] | [((182, 206), 'user.User', 'User', (['userName', 'password'], {}), '(userName, password)\n', (186, 206), False, 'from user import User\n'), ((395, 449), 'credential.Credential', 'Credential', (['firstName', 'lastName', 'accountName', 'password'], {}), '(firstName, lastName, accountName, password)\n', (405, 449), False,... |
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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
#
# ... | [
"InsightToolkit.itkGradientMagnitudeImageFilterF2F2_New",
"InsightToolkit.itkWatershedImageFilterF2_New",
"InsightToolkit.itkImageFileWriterUL2_New",
"InsightToolkit.itkGradientAnisotropicDiffusionImageFilterF2F2_New",
"InsightToolkit.itkImageFileReaderF2_New"
] | [((843, 873), 'InsightToolkit.itkImageFileReaderF2_New', 'itk.itkImageFileReaderF2_New', ([], {}), '()\n', (871, 873), True, 'import InsightToolkit as itk\n'), ((924, 980), 'InsightToolkit.itkGradientAnisotropicDiffusionImageFilterF2F2_New', 'itk.itkGradientAnisotropicDiffusionImageFilterF2F2_New', ([], {}), '()\n', (9... |
import os
import sys
sys.path.append("../../../monk/");
import psutil
from gluon_prototype import prototype
gtf = prototype(verbose=1);
gtf.Prototype("sample-project-1", "sample-experiment-1");
gtf.Default(dataset_path="../../../monk/system_check_tests/datasets/dataset_cats_dogs_train",
model_name="resnet... | [
"gluon_prototype.prototype",
"sys.path.append"
] | [((21, 54), 'sys.path.append', 'sys.path.append', (['"""../../../monk/"""'], {}), "('../../../monk/')\n", (36, 54), False, 'import sys\n'), ((118, 138), 'gluon_prototype.prototype', 'prototype', ([], {'verbose': '(1)'}), '(verbose=1)\n', (127, 138), False, 'from gluon_prototype import prototype\n')] |
"""
Train
=====
Defines functions which train models and write model artifacts to disk.
"""
from __future__ import print_function
import os
import tempfile
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow_mnist import model, paths
def train(path):
"""
Train... | [
"tensorflow_mnist.paths.model",
"os.makedirs",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow_mnist.model.build",
"tempfile.mkdtemp"
] | [((627, 640), 'tensorflow_mnist.model.build', 'model.build', ([], {}), '()\n', (638, 640), False, 'from tensorflow_mnist import model, paths\n'), ((1570, 1590), 'tensorflow_mnist.paths.model', 'paths.model', (['"""mnist"""'], {}), "('mnist')\n", (1581, 1590), False, 'from tensorflow_mnist import model, paths\n'), ((682... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
"proto.RepeatedField",
"proto.Field",
"proto.module",
"proto.MapField"
] | [((705, 914), 'proto.module', 'proto.module', ([], {'package': '"""google.cloud.binaryauthorization.v1"""', 'manifest': "{'Policy', 'AdmissionWhitelistPattern', 'AdmissionRule', 'Attestor',\n 'UserOwnedGrafeasNote', 'PkixPublicKey', 'AttestorPublicKey'}"}), "(package='google.cloud.binaryauthorization.v1', manifest={... |
# General imports
import os, json, logging
import click
from pathlib import Path
import yaml
# From common
from luna_core.common.custom_logger import init_logger
from luna_core.common.DataStore import DataStore_v2
from luna_core.common.Node import Node
from luna_core.common.config import C... | [
"logging.getLogger",
"luna_core.common.custom_logger.init_logger",
"click.option",
"os.path.join",
"luna_core.common.DataStore.DataStore_v2",
"yaml.safe_load",
"luna_core.common.config.ConfigSet",
"luna_core.common.sparksession.SparkConfig",
"click.command",
"json.dump"
] | [((390, 405), 'click.command', 'click.command', ([], {}), '()\n', (403, 405), False, 'import click\n'), ((407, 549), 'click.option', 'click.option', (['"""-a"""', '"""--app_config"""'], {'required': '(True)', 'help': '"""application configuration yaml file. See config.yaml.template for details."""'}), "('-a', '--app_co... |
import numpy as np
import cv2
from matplotlib import pyplot as plt
image = cv2.imread('champaigneditedcompressed.png')
kernel = np.ones((20, 20), np.float32) / 25
img = cv2.filter2D(image, -1, kernel)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
corners = cv2.goodFeaturesToTrack(gray,10,0.01,10)
corners = np.int0(cor... | [
"matplotlib.pyplot.imshow",
"numpy.ones",
"cv2.goodFeaturesToTrack",
"numpy.int0",
"cv2.filter2D",
"cv2.circle",
"cv2.cvtColor",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((77, 120), 'cv2.imread', 'cv2.imread', (['"""champaigneditedcompressed.png"""'], {}), "('champaigneditedcompressed.png')\n", (87, 120), False, 'import cv2\n'), ((171, 202), 'cv2.filter2D', 'cv2.filter2D', (['image', '(-1)', 'kernel'], {}), '(image, -1, kernel)\n', (183, 202), False, 'import cv2\n'), ((210, 247), 'cv2... |
'''
Created on 12 Jun, 2015
@author: artur.mrowca
'''
from enum import Enum
from PyQt5.Qt import QObject
from PyQt5 import QtCore
from tools.ecu_logging import ECULogger
import copy
class AbstractInputHandler(QObject):
publish_infos_sig = QtCore.pyqtSignal(list)
def __init__(self):
... | [
"PyQt5.Qt.QObject.__init__",
"PyQt5.QtCore.pyqtSignal",
"tools.ecu_logging.ECULogger",
"copy.deepcopy"
] | [((258, 281), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['list'], {}), '(list)\n', (275, 281), False, 'from PyQt5 import QtCore\n'), ((322, 344), 'PyQt5.Qt.QObject.__init__', 'QObject.__init__', (['self'], {}), '(self)\n', (338, 344), False, 'from PyQt5.Qt import QObject\n'), ((1429, 1447), 'copy.deepcopy', 'cop... |
################################################################################
# Copyright: <NAME> 2019
#
# Apache 2.0 License
#
# This file contains all code related to pid check objects
#
################################################################################
import re
import requests
from breadp.checks ... | [
"breadp.checks.Check.__init__",
"requests.head",
"re.match",
"breadp.checks.result.BooleanResult"
] | [((586, 606), 'breadp.checks.Check.__init__', 'Check.__init__', (['self'], {}), '(self)\n', (600, 606), False, 'from breadp.checks import Check\n'), ((811, 851), 're.match', 're.match', (['"""^10\\\\.\\\\d{4}\\\\d*/.*"""', 'rdp.pid'], {}), "('^10\\\\.\\\\d{4}\\\\d*/.*', rdp.pid)\n", (819, 851), False, 'import re\n'), (... |
from unittest import TestCase
from src.domain.holiday import Holiday
import src.infrastructure.persistence.holiday_dynamo_repository as repository
HOLIDAY = Holiday(
date='2021-12-25',
name='Natal',
category='NATIONAL'
)
class TestHolidayDynamoRepository(TestCase):
def test_holiday_must_be_dict_when... | [
"src.domain.holiday.Holiday",
"src.infrastructure.persistence.holiday_dynamo_repository.translate_holiday_to_dynamo"
] | [((158, 219), 'src.domain.holiday.Holiday', 'Holiday', ([], {'date': '"""2021-12-25"""', 'name': '"""Natal"""', 'category': '"""NATIONAL"""'}), "(date='2021-12-25', name='Natal', category='NATIONAL')\n", (165, 219), False, 'from src.domain.holiday import Holiday\n'), ((363, 410), 'src.infrastructure.persistence.holiday... |
import logging
import tensorflow as tf
import recsys.util.proto.config_pb2 as config
def int64_feature(val):
return tf.train.Feature(int64_list = tf.train.Int64List(value=[val]))
def int64_list_feature(val_list):
return tf.train.Feature(int64_list = tf.train.Int64List(value=val_list))
def bytes_feature(val):... | [
"tensorflow.local_variables_initializer",
"tensorflow.train.Coordinator",
"tensorflow.parse_single_example",
"tensorflow.Session",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Int64List",
"tensorflow.train.BytesList",
"tensorflow.global_variables_initializer",
"tensorflow.train.Features... | [((3201, 3278), 'tensorflow.train.string_input_producer', 'tf.train.string_input_producer', (['filenames'], {'num_epochs': 'input_config.num_epochs'}), '(filenames, num_epochs=input_config.num_epochs)\n', (3231, 3278), True, 'import tensorflow as tf\n'), ((2818, 2837), 'tensorflow.TFRecordReader', 'tf.TFRecordReader', ... |
'''
This module handles starring of modules.
'''
import web
from app import RENDER
from components import model, session
class StarModule(object):
'''
Class handles starring and unstarring of modules.
'''
def GET(self):
'''
This function is called when /starModule is acce... | [
"components.session.validate_session",
"web.seeother",
"app.RENDER.starredModulesListing",
"web.cookies",
"web.input",
"web.header"
] | [((346, 389), 'web.header', 'web.header', (['"""X-Frame-Options"""', '"""SAMEORIGIN"""'], {}), "('X-Frame-Options', 'SAMEORIGIN')\n", (356, 389), False, 'import web\n'), ((398, 445), 'web.header', 'web.header', (['"""X-Content-Type-Options"""', '"""nosniff"""'], {}), "('X-Content-Type-Options', 'nosniff')\n", (408, 445... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 23 16:21:35 2021
@author: <NAME> <<EMAIL>>
"""
import os
import logging
import pathlib
import pycountry
import mongoengine
from enum import Enum
from typing import Union
from pymongo import database, ReturnDocument
from dotenv import find_dotenv,... | [
"logging.getLogger",
"mongoengine.EnumField",
"mongoengine.ReferenceField",
"dotenv.find_dotenv",
"os.getenv",
"mongoengine.PointField",
"mongoengine.LazyReferenceField",
"mongoengine.EmbeddedDocumentField",
"mongoengine.connection.get_db",
"mongoengine.DictField",
"mongoengine.DateTimeField",
... | [((511, 538), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (528, 538), False, 'import logging\n'), ((1406, 1447), 'mongoengine.StringField', 'mongoengine.StringField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (1429, 1447), False, 'import mongoengine\n'), ((1462, 1500), '... |
#! /usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import torch
from botorch.exceptions.errors import BotorchError, BotorchTensorDime... | [
"torch.stack",
"torch.equal",
"torch.tensor",
"torch.argsort",
"botorch.utils.multi_objective.box_decomposition.NondominatedPartitioning",
"torch.zeros",
"torch.arange"
] | [((724, 764), 'botorch.utils.multi_objective.box_decomposition.NondominatedPartitioning', 'NondominatedPartitioning', ([], {'num_outcomes': '(2)'}), '(num_outcomes=2)\n', (748, 764), False, 'from botorch.utils.multi_objective.box_decomposition import NondominatedPartitioning\n'), ((1053, 1102), 'botorch.utils.multi_obj... |
import pytest
from responses import RequestsMock
from tests import loader
def test_parameter_cannot_be_parsed(responses: RequestsMock, tmpdir):
responses.add(
responses.GET,
url="http://test/",
json={
"swagger": "2.0",
"paths": {
"/test": {
... | [
"pytest.raises",
"tests.loader.load"
] | [((981, 1005), 'pytest.raises', 'pytest.raises', (['Exception'], {}), '(Exception)\n', (994, 1005), False, 'import pytest\n'), ((1033, 1168), 'tests.loader.load', 'loader.load', (['tmpdir', "{'invalid': {'open_api': {'definition': 'http://test/'}, 'formulas': {\n 'dynamic_array': {'lock_excel': True}}}}"], {}), "(tm... |
from random import randint
from typing import Callable, List, Optional
class Coin:
"""Simulates a coin."""
def __init__(self) -> None:
self.__head = False
self.__toss_count = 0
self.__head_count = 0
def toss(self) -> None:
"""Toss a coin."""
r = randint(1, 2)
... | [
"random.randint"
] | [((302, 315), 'random.randint', 'randint', (['(1)', '(2)'], {}), '(1, 2)\n', (309, 315), False, 'from random import randint\n')] |
## @file
# This file is used to define the FMMT dependent external tool management class.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import glob
import logging
import os
import shutil
import sys
import tempfile
import uuid
from edk2basetools.FM... | [
"os.path.exists",
"os.path.isabs",
"subprocess.run",
"os.path.join",
"os.environ.get",
"edk2basetools.FMMT.utils.FmmtLogger.FmmtLogger.info",
"os.path.dirname",
"shutil.rmtree",
"edk2basetools.FMMT.utils.FmmtLogger.FmmtLogger.error"
] | [((473, 519), 'subprocess.run', 'subprocess.run', (['cmd'], {'stdout': 'subprocess.DEVNULL'}), '(cmd, stdout=subprocess.DEVNULL)\n', (487, 519), False, 'import subprocess\n'), ((4102, 4127), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (4117, 4127), False, 'import os\n'), ((4417, 4439), 'os... |
from setuptools import setup, find_packages
setup(
name = "imgdup",
version = "1.3",
packages = find_packages(),
scripts = ['imgdup.py'],
install_requires = ['pillow>=2.8.1'],
# metadata for upload to PyPI
author = "<NAME>",
author_email = "<EMAIL>",
description = "Visual similarity... | [
"setuptools.find_packages"
] | [((108, 123), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (121, 123), False, 'from setuptools import setup, find_packages\n')] |
# 7. Write a program that estimates the average number of drawings it takes before the user’s
# numbers are picked in a lottery that consists of correctly picking six different numbers that
# are between 1 and 10. To do this, run a loop 1000 times that randomly generates a set of
# user numbers and simulates drawings u... | [
"random.choice",
"random.randint"
] | [((537, 558), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (551, 558), False, 'import random\n'), ((570, 600), 'random.choice', 'random.choice', (['lottery_numbers'], {}), '(lottery_numbers)\n', (583, 600), False, 'import random\n')] |
from django.conf import settings
from django.utils.importlib import import_module
from humfrey.update.transform.base import Transform
def get_transforms():
try:
return get_transforms._cache
except AttributeError:
pass
transforms = {'__builtins__': {}}
for class_path in settings.UPDATE... | [
"django.utils.importlib.import_module"
] | [((421, 447), 'django.utils.importlib.import_module', 'import_module', (['module_path'], {}), '(module_path)\n', (434, 447), False, 'from django.utils.importlib import import_module\n')] |
from lib.remote.remote_util import RemoteMachineShellConnection
from pytests.tuqquery.tuq import QueryTests
class TokenTests(QueryTests):
def setUp(self):
if not self._testMethodName == 'suite_setUp':
self.skip_buckets_handle = True
super(TokenTests, self).setUp()
self.n1ql_port... | [
"lib.remote.remote_util.RemoteMachineShellConnection"
] | [((514, 550), 'lib.remote.remote_util.RemoteMachineShellConnection', 'RemoteMachineShellConnection', (['server'], {}), '(server)\n', (542, 550), False, 'from lib.remote.remote_util import RemoteMachineShellConnection\n')] |
import logging
from http import cookiejar as http_cookiejar
from http.cookiejar import http2time # type: ignore
from typing import Any # noqa
from typing import Dict # noqa
from urllib.parse import parse_qs
from urllib.parse import urlsplit
from urllib.parse import urlunsplit
from oic.exception import UnSupported
f... | [
"logging.getLogger",
"oic.utils.sanitize.sanitize",
"oic.exception.UnSupported",
"urllib.parse.urlunsplit",
"urllib.parse.parse_qs",
"http.cookiejar.Cookie",
"http.cookiejar.http2time"
] | [((418, 445), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (435, 445), False, 'import logging\n'), ((1664, 1736), 'urllib.parse.urlunsplit', 'urlunsplit', (['(comp.scheme, comp.netloc, comp.path, _query, comp.fragment)'], {}), '((comp.scheme, comp.netloc, comp.path, _query, comp.fragmen... |
#!/usr/bin/python
#
# Decoding a legacy chain ric
#
import pyrfa
p = pyrfa.Pyrfa()
p.createConfigDb("./pyrfa.cfg")
p.acquireSession("Session1")
p.createOMMConsumer()
p.login()
p.directoryRequest()
p.dictionaryRequest()
p.setInteractionType("snapshot")
def snapshotRequest(chainRIC):
p.marketPriceRequest(chainRIC)
... | [
"pyrfa.Pyrfa"
] | [((70, 83), 'pyrfa.Pyrfa', 'pyrfa.Pyrfa', ([], {}), '()\n', (81, 83), False, 'import pyrfa\n')] |
import requests as reqlib
import os
import re
import random
import time
import pickle
import abc
import hashlib
import threading
from urllib.parse import urlparse
from purifier import TEAgent
from purifier.logb import getLogger
from enum import IntEnum
from typing import Tuple, List, Dict, Optional
cl... | [
"random.uniform",
"pickle.dump",
"urllib.parse.urlparse",
"os.makedirs",
"purifier.TEAgent",
"os.path.join",
"pickle.load",
"requests.get",
"time.sleep",
"os.path.isfile",
"re.match",
"os.path.isdir",
"os.path.basename",
"os.remove"
] | [((1808, 1859), 'os.path.join', 'os.path.join', (['self.page_cache_path', 'cache_file_name'], {}), '(self.page_cache_path, cache_file_name)\n', (1820, 1859), False, 'import os\n'), ((1996, 2027), 'os.path.isfile', 'os.path.isfile', (['cache_file_path'], {}), '(cache_file_path)\n', (2010, 2027), False, 'import os\n'), (... |
import decimal
import hashlib
import json
import requests
import tempfile
import uuid
import os
from tqdm import tqdm
from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor
def sha256_for_file(f, buf_size=65536):
pos = f.tell()
dgst = hashlib.sha256()
while True:
data = f.read(bu... | [
"hashlib.sha256",
"requests_toolbelt.MultipartEncoderMonitor",
"tqdm.tqdm",
"json.dumps",
"requests.get",
"requests_toolbelt.MultipartEncoder",
"decimal.Decimal"
] | [((263, 279), 'hashlib.sha256', 'hashlib.sha256', ([], {}), '()\n', (277, 279), False, 'import hashlib\n'), ((1049, 1109), 'requests.get', 'requests.get', (["('%s%s' % (fission_url, rel_url))"], {'params': 'params'}), "('%s%s' % (fission_url, rel_url), params=params)\n", (1061, 1109), False, 'import requests\n'), ((154... |
from __future__ import annotations
import sys
from skeema.intermediate.compiler.parser import Parser
from skeema import ModelMeta
from skeema import util
def private(name):
return f'_{name}'
class ClassBuilder:
"""
ClassBuilder
"""
@staticmethod
def set_class_module(klass, module_name: st... | [
"skeema.util.class_lookup",
"skeema.intermediate.compiler.parser.Parser.parse"
] | [((772, 799), 'skeema.intermediate.compiler.parser.Parser.parse', 'Parser.parse', (['cls', 'json_str'], {}), '(cls, json_str)\n', (784, 799), False, 'from skeema.intermediate.compiler.parser import Parser\n'), ((1547, 1589), 'skeema.util.class_lookup', 'util.class_lookup', (['module_name', 'base_class'], {}), '(module_... |
# -*- coding: utf-8 -*-
""" Auto Encoder Example.
Using an auto encoder on MNIST handwritten digits.
References:
<NAME>, <NAME>, <NAME>, and <NAME>. "Gradient-based
learning applied to document recognition." Proceedings of the IEEE,
86(11):2278-2324, November 1998.
Links:
[MNIST Dataset] http://yann... | [
"matplotlib.pyplot.draw",
"matplotlib.pyplot.waitforbuttonpress",
"numpy.reshape",
"tflearn.data_utils.shuffle",
"tflearn.datasets.mnist.load_data",
"tflearn.DNN",
"matplotlib.pyplot.subplots",
"tflearn.regression",
"tflearn.fully_connected",
"tflearn.input_data"
] | [((574, 603), 'tflearn.datasets.mnist.load_data', 'mnist.load_data', ([], {'one_hot': '(True)'}), '(one_hot=True)\n', (589, 603), True, 'import tflearn.datasets.mnist as mnist\n'), ((638, 675), 'tflearn.input_data', 'tflearn.input_data', ([], {'shape': '[None, 784]'}), '(shape=[None, 784])\n', (656, 675), False, 'impor... |
"""
## ## ## ## ##
## ## ##
## ## ##
## ## ## ## ## ##
## ##
## ##
##
AUTHOR = <NAME> <<EMAIL>>
"""
import sys
import boto3
import click
import threading
from botocore.exceptions import ClientError
from secureaws import checkaws
from secureaws ... | [
"click.group",
"click.option",
"boto3.Session",
"click.CommandCollection",
"secureaws.rsautil.create_rsa_key_pair"
] | [((1743, 1756), 'click.group', 'click.group', ([], {}), '()\n', (1754, 1756), False, 'import click\n'), ((1806, 1866), 'click.option', 'click.option', (['"""--access-key"""'], {'help': '"""AWS IAM User Access Key"""'}), "('--access-key', help='AWS IAM User Access Key')\n", (1818, 1866), False, 'import click\n'), ((1868... |
# Generated by Django 3.0.4 on 2020-05-04 18:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0002_auto_20200323_0327'),
]
operations = [
migrations.AlterField(
model_name='movieentry',
name='date_watch... | [
"django.db.models.DateField"
] | [((343, 382), 'django.db.models.DateField', 'models.DateField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (359, 382), False, 'from django.db import migrations, models\n')] |
import logging
import couchdb
from collections import deque
from threading import Thread
from pylons import config
from lr.lib import SpecValidationException, helpers as h
from lr.lib.couch_change_monitor import BaseChangeHandler
from lr.model import ResourceDataModel
from couchdb import ResourceConflict
from lr.lib.re... | [
"logging.getLogger",
"collections.deque",
"lr.lib.replacement_helper.ResourceDataReplacement",
"lr.lib.schema_helper.ResourceDataModelValidator.set_timestamps",
"threading.Thread",
"couchdb.Server"
] | [((435, 462), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (452, 462), False, 'import logging\n'), ((1134, 1141), 'collections.deque', 'deque', ([], {}), '()\n', (1139, 1141), False, 'from collections import deque\n'), ((1154, 1185), 'couchdb.Server', 'couchdb.Server', (['self._serverUr... |
import os
from argparse import ArgumentParser
from pathlib import Path
from general_utils import split_hparams_string, split_int_set_str
# from tacotron.app.eval_checkpoints import eval_checkpoints
from tacotron.app import (DEFAULT_MAX_DECODER_STEPS, continue_train, infer,
plot_embeddings, t... | [
"os.environ.keys",
"tacotron.app.validate",
"pathlib.Path",
"general_utils.split_int_set_str",
"argparse.ArgumentParser",
"tacotron.app.infer",
"general_utils.split_hparams_string",
"tacotron.app.continue_train",
"tacotron.app.train"
] | [((2354, 2398), 'general_utils.split_hparams_string', 'split_hparams_string', (["args['custom_hparams']"], {}), "(args['custom_hparams'])\n", (2374, 2398), False, 'from general_utils import split_hparams_string, split_int_set_str\n'), ((2401, 2414), 'tacotron.app.train', 'train', ([], {}), '(**args)\n', (2406, 2414), F... |
# -*- coding: utf-8 -*-
"""
@author: Jim
@project: tornado_learning
@time: 2019/8/20 14:48
@desc:
上传文件
"""
from __future__ import annotations
from tornado_learning.handler import BaseHandler
import os
import uuid
import aiofiles
class UploadHandler(BaseHandler):
async def post(self):
ret_data = {}... | [
"uuid.uuid1",
"os.path.join",
"aiofiles.open"
] | [((711, 766), 'os.path.join', 'os.path.join', (["self.settings['MEDIA_ROOT']", 'new_filename'], {}), "(self.settings['MEDIA_ROOT'], new_filename)\n", (723, 766), False, 'import os\n'), ((795, 825), 'aiofiles.open', 'aiofiles.open', (['file_path', '"""wb"""'], {}), "(file_path, 'wb')\n", (808, 825), False, 'import aiofi... |
"""Main module
"""
# Standard library imports
import string
# Third party imports
import numpy as np
import justpy as jp
import pandas as pd
START_INDEX: int = 1
END_INDEX: int = 20
GRID_OPTIONS = """
{
class: 'ag-theme-alpine',
defaultColDef: {
filter: true,
sortable: false,
resizab... | [
"justpy.WebPage",
"justpy.justpy",
"justpy.Input",
"justpy.Div",
"pandas.DataFrame",
"justpy.AgGrid",
"numpy.arange"
] | [((1576, 1609), 'numpy.arange', 'np.arange', (['START_INDEX', 'END_INDEX'], {}), '(START_INDEX, END_INDEX)\n', (1585, 1609), True, 'import numpy as np\n'), ((1628, 1671), 'pandas.DataFrame', 'pd.DataFrame', ([], {'index': 'index', 'columns': 'headings'}), '(index=index, columns=headings)\n', (1640, 1671), True, 'import... |
""" Unit tests for linked_queue.LinkedQueue """
from dloud_ads import linked_queue
def test_dummy():
""" Test definition"""
the_queue = linked_queue.LinkedQueue()
assert the_queue.is_empty()
assert not the_queue
the_queue.enqueue(2)
assert not the_queue.is_empty()
assert len(the_queue) ... | [
"dloud_ads.linked_queue.LinkedQueue"
] | [((147, 173), 'dloud_ads.linked_queue.LinkedQueue', 'linked_queue.LinkedQueue', ([], {}), '()\n', (171, 173), False, 'from dloud_ads import linked_queue\n')] |
import os
import re
# To use a consistent encoding
from codecs import open as copen
from os import path
from setuptools import find_packages, setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with copen(path.join(here, 'README.rst'), encoding='utf-8') as f:
long... | [
"os.path.dirname",
"setuptools.find_packages",
"os.path.join",
"re.search"
] | [((171, 193), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (183, 193), False, 'from os import path\n'), ((534, 607), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\'\\\\"]*)[\\\'\\\\"]\', ver... |