code stringlengths 1 199k |
|---|
import dbus
import logging
from xdg import BaseDirectory as xdg
import os.path
import json
import sys
from random import random
class GwibberHelper(object):
""" A helper class for gwibber. ideally we would just use
from gi.repository import Gwibber
accounts = Gwibbers.Accounts()
accounts.lis... |
from __future__ import unicode_literals
import re
import validators
from requests.compat import urljoin
from sickbeard import logger, tvcache
from sickbeard.bs4_parser import BS4Parser
from sickchill.helper.common import convert_size, try_int
from sickchill.providers.torrent.TorrentProvider import TorrentProvider
class... |
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from threading import Thread
from functools import partial
from PyQt4.Qt import (
QApplication, QFont, QFontInfo, QFontDialog, QColorDialog, QPainter,
QAbstractListModel, Qt, QIcon, QKeySequ... |
DEBUG = False
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
THREADS_PER_PAGE = 2
SECRET_KEY = ""
TEMPLATE_CONFIGURATION = {
"title" : "dockerComp DDSC (Dockerized Distributed Scientific Computing)",
"header_text" : "dockerComp",
}
HOST = "0.0.0.0"
PORT = 5000 |
from django.conf.urls import url
from api import views
urlpatterns = [
url(r'^$', views.api_root, name='api_root'),
url(r'^stages/$', views.stage_list, name='stage_list'),
url(r'^stage/(?P<pk>[0-9]+)/$', views.stage_details, name='stage_details'),
url(r'^search/stage/$', views.stage_search, name='stage_... |
from abjad import *
def test_spannertools_Glissando_01():
staff = Staff([Note(n, (1, 8)) for n in range(8)])
glissando = spannertools.Glissando()
attach(glissando, staff.select_leaves()[:4])
assert systemtools.TestManager.compare(
staff,
r'''
\new Staff {
c'8 \glissan... |
#!/usr/bin/python
import analyzeData
import analyzePackage
import os
class AnalyzeDataAP(analyzeData.AnalyzeData):
def __init__(self, analyze, path="DATA_AP"):
analyzeData.AnalyzeData.__init__(self, analyze,path)
self.contUfficialAP = 0
self.contRogueAP = 0
extension = ".txt"
... |
"""
Standard PCFG prior for LOTHypotheses
"""
from LOTlib.Miscellaneous import attrmem, Infinity
class PCFGPrior(object):
@attrmem('prior')
def compute_prior(self):
"""Compute the log of the prior probability.
"""
# If we exceed the maximum number of nodes, give -Infinity prior
... |
from lib.instructions.base.instruction import Instruction
from lib.app.decorators import Overrides
class ClickCheckboxInstruction(Instruction):
"""
click [ checkbox | cbxs ] ( STRING-LIST | TEXT-LIST | NUM )
Clicks a checkbox. The checkbox can be identified by it's name it's label
or by ... |
from multiprocessing import Process, Queue
import time
import locale, gettext
import os
from gi.repository import Gtk
from gi.repository import GLib
import numpy as np # stupid!!!
from numpy import *
import matplotlib.pyplot as plt
import compy as cp
APP = "schr"
TRANSLATION_DIR = ".\translations"
VERSION = "0.1~alpha"... |
"""Tests for Installer
@Requirement: Installer
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: CLI
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from robottelo.decorators import run_only_on, stubbed
from robottelo.test import CLITestCase
class InstallerTestCase(CLITestCase):
"""Tes... |
from mediadrop.lib.test.db_testcase import DBTestCase
from mediadrop.lib.test.pythonic_testcase import *
from mediadrop.lib.test.request_mixin import RequestMixin
from mediadrop.lib.util import url_for
class URLForTest(DBTestCase, RequestMixin):
def test_can_generate_static_url_with_proxy_prefix(self):
self... |
import numpy
from pandas import MultiIndex, DataFrame
import pandas as pandas
from ert.test import ExtendedTestCase
class NumpyAndPandasTest(ExtendedTestCase):
def test_numpy(self):
data = numpy.empty(shape=(10, 10), dtype=numpy.float64)
data.fill(numpy.nan)
self.assertTrue(numpy.isnan(data[... |
"""Setup for piazza XBlock."""
import os
from setuptools import setup
def package_data(pkg, roots):
"""Generic function to find package_data.
All of the files under each of the `roots` will be declared as package
data for package `pkg`.
"""
data = []
for root in roots:
for dirname, _, fi... |
from gui.contextMenu import ContextMenu
import gui.mainFrame
import wx
import gui.globalEvents as GE
from service.fit import Fit
from service.settings import ContextMenuSettings
class MutaplasmidCM(ContextMenu):
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
self.settings... |
from common import *
import os
import sys
import io
import logging
import requests
import json
import datetime
import time
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFResourceManager
from pdfminer.pdfinterp ... |
from ctypes import *
import win32api, win32con
from .base import PyMouseMeta, PyMouseEventMeta, ScrollSupportError
import pythoncom
from time import sleep
class POINT(Structure):
_fields_ = [("x", c_ulong),
("y", c_ulong)]
class PyMouse(PyMouseMeta):
"""MOUSEEVENTF_(button and action) constants
... |
from chill import *
source('p48.c')
destination('p48modified.c')
procedure('foo')
loop(0)
original()
print_dep()
unroll(0,1,0)
unroll(0,2,0) |
from rest_framework import status
from ava_core.abstract.test import AvaCoreTest
from ava_core.integration.integration_ldap.test_data import LDAPIntegrationAdapterTestData
class LDAPIntegrationAdapterTest(AvaCoreTest):
"""
LDAPIntegrationAdapter Test
"""
def setUp(self):
# Make call to super.
... |
../../../../../share/pyshared/twisted/test/stdio_test_writeseq.py |
"""
Expand Hypergeometric (and Meijer G) functions into named
special functions.
The algorithm for doing this uses a collection of lookup tables of
hypergeometric functions, and various of their properties, to expand
many hypergeometric functions in terms of special functions.
It is based on the following paper:
... |
from __future__ import (absolute_import, division, print_function)
from mantid.api import mtd
import numpy.testing
from testhelpers import illhelpers, run_algorithm
import unittest
class DirectILLCollectDataTest(unittest.TestCase):
_BKG_LEVEL = 2.3
_TEST_WS_NAME = 'testWS_'
_TEST_WS = None
def __init__(... |
from m5.params import *
from BaseTrafficGen import *
class TrafficGen(BaseTrafficGen):
type = 'TrafficGen'
cxx_header = "cpu/testers/traffic_gen/traffic_gen.hh"
# Config file to parse for the state descriptions
config_file = Param.String("Configuration file describing the behaviour") |
import sys, os
from common import db_connection
from subprocess import check_call
if len(sys.argv) != 2:
print >> sys.stderr, "Usage: %s <TERMINAL-ID>" % (sys.argv[0],)
sys.exit(1)
terminal_id = int(sys.argv[1], 10)
c = db_connection.cursor()
c.execute("""SELECT cici.class_instance_b
FROM class_instance_class... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Equipment.internet_provider'
db.alter_column('telecomm_equipment', 'internet_provider_id', self.gf('django.db.models.... |
"""
Copyright 2013 Steven Diamond
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
di... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
from ansible_collections... |
"""
Gisto - Gitso is to support others
Gitso is a utility to facilitate the connection of VNC
@author: Aaron Gerber ('gerberad') <gerberad@gmail.com>
@author: Derek Buranen ('burner') <derek@buranen.info>
@copyright: 2008 - 2010
Gitso is free software: you can redistribute it and/or modify
it under the terms of the GNU... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'certified'}
DOCUMENTATION = '''
---
module: ec2_eip
short_description: manages EC2 elastic IP (EIP) addresses.
description:
- This module can allocate or release an EIP.
- This ... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.stanza import Error
from sleekxmpp.stanza.rootstanza import RootStanza
from sleekxmpp.xmlstream import StanzaBase, ET
from sleekxmp... |
class PysqliteNotAvailable(Exception):
'''sqlite2 is not installed or python bindings are missing'''
def __init__(self):
Exception.__init__(self)
def __str__(self):
return _('pysqlite2 (aka python-pysqlite2) dependency is missing. Exiting...')
class PysqliteOperationalError(Exception):
'''sqlite2 raised pysqlit... |
"""
This module parses the markable layer of a KAF/NAF object
"""
from __future__ import print_function
from lxml import etree
from .external_references_data import CexternalReferences
from .span_data import Cspan
from .term_data import Cterm
class Cmarkable:
"""
This class encapsulates a <markable> NAF or KAF ... |
from deluge.plugins.init import PluginInitBase
class CorePlugin(PluginInitBase):
def __init__(self, plugin_name):
from .core import Core as _pluginCls
self._plugin_cls = _pluginCls
super(CorePlugin, self).__init__(plugin_name)
class GtkUIPlugin(PluginInitBase):
def __init__(self, plugin_... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = """
---
module: nxos_facts
extends_documentation_fragment: nxos
version_added: "2.1"
short_description: Gets facts about NX-OS switches
description:
- Collects facts... |
from __future__ import absolute_import, division, print_function
from copy import deepcopy
from uuid import uuid4
from sqlalchemy import desc
from invenio_pidstore.models import PersistentIdentifier
from inspirehep.modules.disambiguation.models import DisambiguationRecord
from inspirehep.modules.disambiguation.receiver... |
"""Routines to generate root and server certificates.
Certificate Naming Conventions:
ca_cert: crypto.X509 for the certificate authority (w/ both the pub &
priv keys)
cert: a crypto.X509 certificate (w/ just the pub key)
cert_str: a certificate string (w/ just the pub cert)
key: a private cr... |
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import urllib
from contextlib import closing
from lxml impo... |
from __future__ import absolute_import, division, print_function
from ansible.module_utils.k8s.common import KubernetesAnsibleModule
try:
from openshift.dynamic.exceptions import DynamicApiError, NotFoundError, ConflictError
except ImportError:
# Exception handled in common
pass
class KubernetesRawModule(Ku... |
import flask
import os
import shutil
import prism
from prism.api.plugin import BasePlugin
from prism.pyversions import PythonVersions
from prism_crachit import Service
from prism_jack import JackPlugin, SiteTypeConfig
class JackGUnicornConfigPlugin(BasePlugin):
pass
class GUnicornConfig(SiteTypeConfig):
def __i... |
from django.template.defaultfilters import stringfilter
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def admin_media_prefix(context):
"""
Returns path prefix to admin media assets, since ADMIN_MEDIA_PREFIX
is deprecated in Django 1.4.
"""
if cont... |
from StringIO import StringIO
import json
import zipfile
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic import View
from lxml import etree
from lxml.etree import XMLSyntaxError
from ts_om.models import Sc... |
import landed_cost_position_invoice
import shipment_wizard |
"""
Main module which shows problems (of "capa" type).
This is used by capa_module.
"""
from copy import deepcopy
from datetime import datetime
import logging
import os.path
import re
from lxml import etree
from pytz import UTC
from xml.sax.saxutils import unescape
from capa.correctmap import CorrectMap
import capa.inp... |
""" Views related to logout. """
import re
import urllib.parse as parse # pylint: disable=import-error
from urllib.parse import parse_qs, urlsplit, urlunsplit # pylint: disable=import-error
import bleach
from django.conf import settings
from django.contrib.auth import logout
from django.utils.http import urlencode
fr... |
"""
This config file runs the simplest dev environment"""
from .common import *
from logsettings import get_logger_config
DEBUG = True
USE_I18N = True
LANGUAGES = (
('eo', 'Esperanto'),
)
TEMPLATE_DEBUG = DEBUG
LOGGING = get_logger_config(ENV_ROOT / "log",
logging_env="dev",
... |
from . import test_res_partner |
from cl.audio.models import Audio
from cl.favorites.forms import FavoriteForm
from cl.favorites.models import Favorite
from cl.search.models import OpinionCluster
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from djan... |
from logging import getLogger
from libcloud.compute.drivers.gce import GCEAddress
from sdcm.utils.cloud_monitor.common import NA
from sdcm.utils.cloud_monitor.resources import CloudResources
from sdcm.utils.common import list_elastic_ips_aws, aws_tags_to_dict, list_static_ips_gce
LOGGER = getLogger(__name__)
class Stat... |
from __future__ import unicode_literals
from udata.core.metrics import Metric
from udata.i18n import lazy_gettext as _
from .signals import on_badge_added, on_badge_removed
class BadgesMetric(Metric):
name = 'badges'
display_name = _('Badges')
def get_value(self):
return (self.model_badge.objects(su... |
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth import login, authenticate
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.contrib import messages
from django.utils.translation import ug... |
from django.db import transaction
from education_group.ddd import command
from education_group.ddd.domain.training import TrainingIdentity
from education_group.ddd.repository import training as training_repository
from education_group.ddd.validators.validators_by_business_action import DeleteOrphanTrainingValidatorList... |
from __future__ import unicode_literals
from django.test import TestCase
from nose.plugins.attrib import attr
from candidates.models import PersonExtra, SiteSettings
from candidates.tests import factories
from candidates.tests.uk_examples import UK2015ExamplesMixin
@attr(country='uk')
class CSVTests(UK2015ExamplesMixin... |
"""
Copyright 2013 Olivier Cortès <oc@1flow.io>
This file is part of the 1flow project.
1flow is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at ... |
from __future__ import unicode_literals, absolute_import
from udata import mail
from udata.i18n import lazy_gettext as _
from udata.models import Activity, Metrics, Issue, Discussion, Follow
from udata.tasks import get_logger, job, task
from .models import Reuse
log = get_logger(__name__)
@job('purge-reuses')
def purge... |
import sys, wave, audioop, re, os #needs os and time aswell in CMD mode (UPDATE 2018/07/04: os used to get devnull for discarding subprocess output)
import numpy as np
import subprocess # used for ffmpeg
import tempfile, shutil # temporary directory whilst exporting, shutil to clean up after
import time
try:
from PIL ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('errata', '0048_auto_20200807_1056'),
]
operations = [
migrations.AlterField(
model_name='errata',
name='status',
field=models.CharField(choices=[('New', 'New... |
from openerp import http
from openerp.http import request
from openerp.addons.website.controllers.main import Website
class Main(Website):
@http.route()
def index(self, **kw):
return request.redirect('/web') |
from __future__ import absolute_import
from .api import Request, Response
from .struct import Struct
from .types import Array, Bytes, Int16, Int32, Schema, String
class JoinGroupResponse_v0(Response):
API_KEY = 11
API_VERSION = 0
SCHEMA = Schema(
('error_code', Int16),
('generation_id', Int3... |
from spack import *
class Pumi(CMakePackage):
"""SCOREC RPI's Parallel Unstructured Mesh Infrastructure (PUMI).
An efficient distributed mesh data structure and methods to support
parallel adaptive analysis including general mesh-based operations,
such as mesh entity creation/deletion, adjacenc... |
from pyDatalog import pyDatalog
pyDatalog.create_atoms('people, alice, bob')
+ people(alice)
print people
pyDatalog.create_atoms('X')
print(people(X))
for i in people(X): print i
+ people(bob)
for i in people(X): print i
type(bob)
type(people)
type(X)
print type(people(X))
pyDatalog.create_atoms('label')
+ label(people... |
from spack import *
class Cleverleaf(CMakePackage):
"""CleverLeaf is a hydrodynamics mini-app that extends CloverLeaf with
Adaptive Mesh Refinement using the SAMRAI toolkit from Lawrence
Livermore National Laboratory. The primary goal of CleverLeaf is
to evaluate the application of AMR to the L... |
"""Run the EasyInstall command"""
if __name__ == '__main__':
from setuptools.command.easy_install import main
main() |
"""
A repository is a collection of ``ImageSource`` s which are published in a git repo.
"""
import os
import shutil
import json
import subuserlib.subprocessExtras
from subuserlib.classes.userOwnedObject import UserOwnedObject
from subuserlib.classes.imageSource import ImageSource
from subuserlib.classes.describable im... |
import numpy as np
from ase.test import NotAvailable
try:
import scipy
except ImportError:
raise NotAvailable('This needs scipy module.')
from ase.lattice import bulk
from ase.io.trajectory import Trajectory
from ase.calculators.emt import EMT
eVA3ToGPA = 160.21773
ref = {
'volumes': [29.205536, 30.581492, ... |
VERSION = (1, 0, 6)
__version__ = '.'.join(map(str, VERSION)) |
import re
import threading
from oslo_config import cfg
from oslo_log import log as logging
from sahara import conductor as c
from sahara import context
from sahara.i18n import _
from sahara.plugins import provisioning as plugin_base
from sahara.utils import cluster_progress_ops as cpo
from sahara.utils.openstack import... |
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.mathjax', 'sphinx.ext.githubpages', 'lean_sphinx']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Logic and Proof'
copyright = u'2017, Jeremy Avigad, Robert Y. Lewis, and Floris van Doorn'
au... |
"""
twython.endpoints
~~~~~~~~~~~~~~~~~
This module provides a mixin for a :class:`Twython <Twython>` instance.
Parameters that need to be embedded in the API url just need to be passed as a keyword argument.
e.g. Twython.retweet(id=12345)
This map is organized the order functions are documented at:
https://dev.twitter... |
from subprocess import Popen
from threading import Thread
import json
import sys
import re
import os
import stat
import tempfile
import shutil
import difflib
import subprocess
import time
import random
import errno
try:
from scapy.layers.all import *
from scapy.utils import *
except ImportError:
pass
from b... |
from unittest import mock
from solum.conductor.handlers import default
from solum.tests import base
class HandlerTest(base.BaseTestCase):
def test_create(self):
handler = default.Handler()
handler.echo = mock.MagicMock()
handler.echo({}, 'foo')
handler.echo.assert_called_once_with({}... |
import mock
from oslo_config import cfg
from neutron.common import exceptions as n_exc
from neutron import context
from neutron import manager
from neutron.objects import base as base_object
from neutron.objects.qos import policy as policy_object
from neutron.objects.qos import rule as rule_object
from neutron.plugins.... |
"""Common functionality."""
import os.path
import tempfile
import shutil
import subprocess
import sys
import six
from nose2.compat import unittest
from nose2 import discover, util
HERE = os.path.abspath(os.path.dirname(__file__))
SUPPORT = os.path.join(HERE, 'functional', 'support')
class TestCase(unittest.TestCase):
... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
def h2o_H2OFrame():
"""
Python API test: h2o.frame.H2OFrame(python_obj=None, destination_frame=None, header=0, ... |
from tempest_lib.common.utils import data_utils # noqa
from tempest_lib import exceptions as lib_exc # noqa
from tempest.api.share import base
from tempest import clients_share as clients
from tempest import test
class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):
def _create_share_type(self):
na... |
"""A convolutional neural network for CIFAR-10 classification.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from utils import cifar
from utils.utils import put_kernels_on_grid
EPOCH = 36000
BATCH_SIZE = 128
def weight_variable_w... |
from __future__ import print_function
import numpy as np
import argparse
import time
import math
import paddle
import paddle.fluid as fluid
import paddle.fluid.profiler as profiler
from paddle.fluid import core
import unittest
from multiprocessing import Process
import os
import signal
from functools import reduce
from... |
from datetime import datetime, timedelta
import hashlib
import os
import random
import tempfile
import time
from glob import glob
from py4j.protocol import Py4JJavaError
from pyspark import shuffle, RDD
from pyspark.resource import ExecutorResourceRequests, ResourceProfileBuilder,\
TaskResourceRequests
from pyspark... |
import json
import sys
import time
import comic_hentai_data_source
def now():
return time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime(int(time.time())))
def driver(total_json_path):
comic_list = read_comic_data_from_json(total_json_path)
write_comic_data_to_db(comic_list)
def read_comic_data_from_json(to... |
import datetime
import time
from email.utils import formatdate, parsedate
from xml.sax.saxutils import escape, quoteattr
from django.conf import settings
from django.http import Http404, HttpResponse, HttpResponseNotAllowed, HttpResponseNotModified, StreamingHttpResponse
from django.shortcuts import redirect
from djang... |
"""
Checks Version.
"""
from ignitetest import __version__
from ignitetest.utils.version import IgniteVersion, DEV_BRANCH, LATEST
def check_dev_version():
""""
Check developer version.
"""
dev = IgniteVersion('dev')
ignite_dev = IgniteVersion('ignite-dev')
fork_dev = IgniteVersion('fork-dev')
... |
from ducktape.mark import parametrize
import json
from kafkatest.services.console_consumer import ConsoleConsumer
from kafkatest.services.kafka import KafkaService
from kafkatest.services.kafka import config_property
from kafkatest.services.verifiable_producer import VerifiableProducer
from kafkatest.services.zookeeper... |
import functools
import itertools
import os
import re
import urlparse
from oslo.config import cfg
import webob
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova.compute import task_states
from nova.compute import utils as compute_utils
from nova.compute import vm_states
from nova impo... |
import mock
from sahara.service.api import v10 as api
from sahara.service.validations.edp import job_binary_internal as jb
from sahara.service.validations.edp import job_binary_internal_schema as jbs
from sahara.tests.unit.service.validation import utils as u
class TestJobBinaryInternalCreateValidation(u.ValidationTest... |
from lxml import etree
import webob
from nova.api.openstack.compute.contrib import quota_classes
from nova.api.openstack import wsgi
from nova import test
from nova.tests.api.openstack import fakes
def quota_set(class_name):
return {'quota_class_set': {'id': class_name, 'metadata_items': 128,
'ram': 512... |
"""TensorFlow Eager execution prototype.
EXPERIMENTAL: APIs here are unstable and likely to change without notice.
To use, at program startup, call `tf.enable_eager_execution()`.
@@metrics
@@list_devices
@@num_gpus
@@py_func
@@defun
@@function
@@make_template
@@implicit_gradients
@@implicit_value_and_gradients
@@gradie... |
from __future__ import print_function
import argparse
import os
import sys
from time import (sleep, time)
from random import randrange
import math
import argparse
import traceback
import logging
from random import randrange
from pyocd.core.target import Target
from pyocd.coresight.cortex_m import CortexM
from pyocd.gdb... |
import logging
import os
import sys
import warnings
import django
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import exceptions
from openstack_dashboard.static_settings import get_staticfiles_dirs # noqa
warnings.formatwarning = lambda message, category, *args, **kwargs: \
'%s:... |
from __future__ import absolute_import, division, print_function, \
with_statement
import hashlib
from crypto import openssl
__all__ = ['ciphers']
def create_cipher(alg, key, iv, op, key_as_bytes=0, d=None, salt=None,
i=1, padding=1):
md5 = hashlib.md5()
md5.update(key)
md5.update(iv)
... |
"""
urlresolver XBMC Addon
Copyright (C) 2013 Bstrdsmkr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import re
import warnings
import typing
from builtins import str
from typing import Any
from typing import Dict
from typing ... |
import os
import ssl
from oslo.config import cfg
from heat.openstack.common.gettextutils import _
ssl_opts = [
cfg.StrOpt('ca_file',
default=None,
help="CA certificate file to use to verify "
"connecting clients"),
cfg.StrOpt('cert_file',
default=... |
import abc
from collections import OrderedDict
import datetime
import copy
import iso8601
import netaddr
from oslo_utils import strutils
from oslo_utils import timeutils
import six
from nova.compute import arch
from nova.compute import cpumodel
from nova.compute import hv_type
from nova.compute import vm_mode
from nova... |
import time
from threading import Thread
import sys
from InputGetter import *
class PlaylistAdvanceThread(Thread):
"""
Advances the active playlist periodically.
"""
def __init__(self, renderer, switchInterval):
Thread.__init__(self)
self.daemon = True
self.renderer = renderer
... |
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
import oslo_messaging
LOG = logging.getLogger(__name__)
class DVRServerRpcApi(object):
... |
"""
v2 Neutron Plug-in API specification.
:class:`NeutronPluginBaseV2` provides the definition of minimum set of
methods that needs to be implemented by a v2 Neutron Plug-in.
"""
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class NeutronPluginBaseV2(object):
@abc.abstractmethod
def create_subnet(self, ... |
from nova.api.validation import parameter_types
server_create = {
'os-config-drive:config_drive': parameter_types.boolean,
} |
import abc
import logging
log = logging.getLogger(__name__)
class AbstractPartitionAssignor(object):
"""
Abstract assignor implementation which does some common grunt work (in particular collecting
partition counts which are always needed in assignors).
"""
@abc.abstractproperty
def name(self):
... |
from atelier.invlib import setup_from_tasks
ns = setup_from_tasks(
globals(), 'lino_book',
# tolerate_sphinx_warnings=True,
blogref_url="http://luc.lino-framework.org",
revision_control_system='git',
# help_texts_source='docs',
# help_texts_module='lino_xl.lib.xl',
cleanable_files=[
... |
"""
***************
Graphviz AGraph
***************
Interface to pygraphviz AGraph class.
Examples
--------
>>> G=nx.complete_graph(5)
>>> A=nx.to_agraph(G)
>>> H=nx.from_agraph(A)
See Also
--------
Pygraphviz: http://networkx.lanl.gov/pygraphviz
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all__ = ['from_a... |
from __future__ import unicode_literals
import io
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.handlers.wsgi import WSGIHandler
from django.test import override_settings, testcases
from django.test.client import Client as D... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.