code stringlengths 1 199k |
|---|
"""
A simple text encoding of dimod binary quadratic models (BQMs).
The COOrdinate_ list is a sparse matrix representation which can be used to
store BQMs. This format is best used when readability is important.
.. note:: This format works only for BQMs labelled with positive integers.
.. _COOrdinate: https://en.wikipe... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v10.enums",
marshal="google.ads.googleads.v10",
manifest={"MonthOfYearEnum",},
)
class MonthOfYearEnum(proto.Message):
r"""Container for enumeration of months of the year, e.g.,
"January".
"""
class Month... |
"""A PPO Agent implementing the KL penalty loss.
Please see details of the algorithm in (Schulman,2017):
https://arxiv.org/abs/1707.06347.
Disclaimer: We intend for this class to eventually fully replicate the KL
penalty version of PPO from:
https://github.com/openai/baselines/tree/master/baselines/ppo1
We are still wo... |
import sys
import eventlet
eventlet.monkey_patch(
os=True,
select=True,
socket=True,
thread=False if '--use-debugger' in sys.argv else True,
time=True)
import os
POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
... |
from oslo_config import cfg
from oslo_log import log
from keystone.common import controller
from keystone.common import dependency
from keystone.common import validation
from keystone import exception
from keystone import notifications
from keystone.policy import schema
CONF = cfg.CONF
LOG = log.getLogger(__name__)
_RU... |
import mock
from unittest import TestCase
from alamo_worker.alerter.plugins.image_renderer import ImageRendererPlugin
from alamo_worker.alerter.preprocessor import AlertPreprocessor
from alamo_common.test.utils import override_settings
from tests.base import run_async, AsyncMock
class AlertPreprocessorTestcase(TestCase... |
from django.conf.urls import patterns, url
from masays import views
urlpatterns = patterns('',
# ex: /masays/
url(r'^$', views.index, name = 'index'),
# ex: /masays/mobile/
url(r'^mobile/$', views.mobile, name = 'mobile'),
# ex: /masays/web/
url(r'^web/$', views.web, name = 'web'),
) |
import os
import sys
import time
from wlauto.core.extension import Parameter
from wlauto.core.workload import Workload
from wlauto.core.resource import NO_ONE
from wlauto.common.resources import ExtensionAsset, Executable
from wlauto.exceptions import WorkloadError, ResourceError, ConfigError
from wlauto.utils.android ... |
from __future__ import absolute_import
import httplib
from cinderclient import exceptions
from oslo_log import log as logging
from powervc.common import constants as common_constants
from powervc.common.gettextutils import _
from powervc.volume.manager import constants
from cinder import exception
from cinder import db... |
""" ATMega128RFA1 Temperature and Power Supply Sensors
Notes:
1. Each ATMega sensor varies by several degrees so it needs to be calibrated once for offset against
the actual temperature and the offset stored in non-volatile memory. I recommend the Yocto sensor
to calibrate against: http://www.yocto... |
from .impl_base import ImplTestMixin
try: # pragma: no cover
from .. import impl_cython as oath
except ImportError: # pragma: no cover
oath = None
from . import unittest
skipUnlessBase32Decode = unittest.skipUnless(hasattr(oath, 'base32_decode'),
'base32_decode not... |
""" test cases for the kmeans clustering algorithm """
import unittest
from sparktkregtests.lib import scoring_utils
from sparktkregtests.lib import sparktk_test
class ArimaxTest(sparktk_test.SparkTKTestCase):
def setUp(self):
super(ArimaxTest, self).setUp()
schema = [("Int", int),
... |
"""Pure-Python RSA cryptography implementation.
Uses the ``rsa``, ``pyasn1`` and ``pyasn1_modules`` packages
to parse PEM files storing PKCS#1 or PKCS#8 keys as well as
certificates. There is no support for p12 files.
"""
from __future__ import absolute_import
import io
import json
from pyasn1.codec.der import decoder
... |
from . import init
from .layers import * |
from __future__ import with_statement
from mapproxy.platform.image import (
Image,
ImageDraw,
ImageColor,
ImageFont,
)
from mapproxy.cache.tile import Tile
from mapproxy.image import ImageSource
from mapproxy.image.message import TextDraw, message_image
from mapproxy.image.opts import ImageOptions
from ... |
import os
import sys
import logging
from flask import Flask, render_template
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
file_handler = logging.FileHandler(app.config['APP_LOGGER_DIR'] + 'log.txt')
file_handler.setLevel(logging.DEBUG)
file_hand... |
"""Support for Xiaomi Mi Air Quality Monitor (PM2.5) and Humidifier."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
import logging
from miio import AirQualityMonitor, DeviceException
from miio.gateway.gateway import (
GATEWAY_MODEL_AC_V1,
GATEWAY_MODEL_AC_V2,
G... |
from muntjac.ui.text_field import TextField
from muntjac.demo.sampler.APIResource import APIResource
from muntjac.demo.sampler.Feature import Feature, Version
class TextArea(Feature):
def getSinceVersion(self):
return Version.OLD
def getName(self):
return 'Text area'
def getDescription(self)... |
import numpy as np
import subprocess, sys, os.path
from itertools import *
import pandas as pd
import logging
from pysnptools.snpreader import SnpReader
from pysnptools.snpreader import SnpData
import warnings
from pysnptools.pstreader import _OneShot
class Dat(_OneShot,SnpReader):
'''
A :class:`.SnpReader` for... |
"""Recurrent layers and their base classes.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import uuid
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.eager import function
from tensorflow.python.framework import con... |
"""
SentientHome event handler.
Author: Oliver Ratzesberger <https://github.com/fxstein>
Copyright: Copyright (C) 2017 Oliver Ratzesberger
License: Apache License, Version 2.0
"""
from collections import deque
import copy
import json
import os
import pickle
import requests
import time
class shEventHandler(objec... |
import logging
import os
from pathlib import Path
import tempfile
import warnings as pywarnings
import typing
from collections import defaultdict, namedtuple
from typing import Any, Dict, List, Optional, Text, Tuple
from rasa import telemetry
from rasa.core.constants import (
CONFUSION_MATRIX_STORIES_FILE,
REPO... |
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import r2_score
from pyrbfn import RBFN, NormalizedRBFN, HyperplaneRBFN, GaussianRBF, \
AdaptiveRBFN, AdaptiveHyperplaneRBFN
indim, bases, outdim, alpha, eta = 1, 5, 1, 0.5, 0.001
mu = np.linspace(0, 3.5, num=bases, endpoint=True).reshape((base... |
import sys
import random
value=random.randint(0, 3)
print("Returning: " + str(value))
sys.exit(value) |
import os
import pytest
from tests.links.absolute_path import absolute_path
@pytest.mark.parametrize("target_dir, rel_dir, expected_return", [
("local_dir", None, os.path.join(os.getcwd(), "local_dir")),
("rel_dir", '/tmp', os.path.join('/tmp', "rel_dir")),
("", None, os.getcwd()),
(None, None, os.getcw... |
"""Wrapper around 'git log'."""
from __future__ import absolute_import
import collections
import string
"""NamedTuple to represent a git revision.
:hash:the sha1 associated with this revision
:author_email:the email address of the original author
:author_name:the name of the original author
:committer_email:the email a... |
import cv2
import numpy as np
face_cascade = cv2.CascadeClassifier('cascade_files/haarcascade_frontalface_alt.xml')
eye_cascade = cv2.CascadeClassifier('cascade_files/haarcascade_eye.xml')
nose_cascade = cv2.CascadeClassifier('cascade_files/haarcascade_mcs_nose.xml')
mouth_cascade = cv2.CascadeClassifier('cascade_files... |
'''
BMC HMM IFacade
'''
from Products.Zuul.interfaces import IFacade
from Products.Zuul.utils import ZuulMessageFactory as _t
class IBMCFacade(IFacade):
'''
IBMCFacade
'''
def bootsequence(self, devobj, deviceip, bootsequence, boottype):
""" Modify deviceip / bootsequence boottype for a device o... |
"""
Error handlers
Handles all of the HTTP Error Codes returning JSON messages
"""
from flask import jsonify, make_response
from service import app
from service.models import DataValidationError, DatabaseConnectionError
from . import status
@app.errorhandler(DatabaseConnectionError)
def database_connection_error(error)... |
from plumbery.fitting import PlumberyFitting
class EthernetFitting(PlumberyFitting):
"""
Represents a VLAN
"""
def parse(self, settings):
"""
Parses and checks settings
:param settings: specific settings for this fittings
:type settings: ``dict``
This function rai... |
from fuzzywuzzy import fuzz
import fnmatch,glob
def matches_from_list(item,options,fuzzy=90,fname_match=True,fuzzy_fragment=None,guess=False):
'''Returns the members of ``options`` that best matches ``item``. Will prioritize
exact matches, then filename-style matching, then fuzzy matching. Returns a tuple of it... |
'''jinja port'''
from __future__ import absolute_import, unicode_literals |
from django.conf.urls import patterns,url
from fetch import views
urlpatterns = patterns('',
url(r'^$',views.index),
url(r'^fetch8bo',views.fetch_8bo),
) |
from typing import Optional, Union, List, Callable
import numpy as np
import tensorflow as tf
from docqa.configurable import Configurable
from tensorflow.contrib.keras import activations
from tensorflow.contrib.keras import initializers
from tensorflow.python.layers.core import fully_connected
from docqa.model import P... |
import pytest
from decimal import Decimal
from django.core.urlresolvers import reverse
from checkout.models import CheckoutAction
from checkout.tests.factories import (
CheckoutFactory,
CheckoutSettingsFactory,
)
from example_checkout.tests.factories import SalesLedgerFactory
from checkout.views import CONTENT_... |
import netaddr
from oslo.config import cfg
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
from sqlalchemy.orm.properties import RelationshipProperty
from neutron import context as neutron_context
from neutron.common import core as sql
from neutron.db import model_base
from neutron.db ... |
from __future__ import absolute_import, print_function
from collections import deque
import logging
import os
import re
import nltk
import commoncode
from textcode import analysis
from cluecode import copyrights_hint
COPYRIGHT_TRACE = 0
logger = logging.getLogger(__name__)
if os.environ.get('SCANCODE_COPYRIGHT_DEBUG'):... |
from __future__ import unicode_literals
import json
import logging
import os
import uuid
from mopidy import config, ext
import pydblite as pydb
import tornado.web
import tornado.websocket
__version__ = '0.1.0'
__static_path__ = 'static'
__config_path__ = 'ext.conf'
logger = logging.getLogger(__name__)
db = pydb.Base("v... |
from __future__ import division, print_function, absolute_import, unicode_literals
import itertools
import h2o
from h2o.job import H2OJob
from h2o.frame import H2OFrame
from h2o.exceptions import H2OValueError
from h2o.estimators.estimator_base import H2OEstimator
from h2o.two_dim_table import H2OTwoDimTable
from h2o.d... |
import pandas
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.font_manager
from scipy import stats
from sklearn.preprocessing import scale
from sklearn import svm
from sklearn.decomposition import PCA
from utils import *
OUTLIER_FRACTION = 0.01
"""
Script
"""
raw_data = load_data_from_csv('data\par... |
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: hjelp@mailmojo.no
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import mailmojo_sdk
from mailmojo_sdk.models.list_detail import Lis... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class DeleteEmailAddress(Choreography):
def __init__(self, temboo_session):
"""
Create... |
"""
Copyright (c) 2017 SONATA-NFV and Paderborn University
ALL RIGHTS RESERVED.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appli... |
import os
import sys
from apps import default, rok
from kubeflow.kubeflow.crud_backend import config, logging
log = logging.getLogger(__name__)
def get_config(mode):
"""Return a config based on the selected mode."""
config_classes = {
config.BackendMode.DEVELOPMENT.value: config.DevConfig,
confi... |
from django.core.management.base import BaseCommand
from applications.product.models import Category, Product
from applications.discount.models import Action
__author__ = 'Alex Starov'
class Command(BaseCommand, ):
def handle(self, *args, **options):
try:
action_category = Category.objects.get(u... |
from google.cloud import dialogflow_v2
def sample_delete_entity_type():
# Create a client
client = dialogflow_v2.EntityTypesClient()
# Initialize request argument(s)
request = dialogflow_v2.DeleteEntityTypeRequest(
name="name_value",
)
# Make the request
client.delete_entity_type(req... |
import os
import logging
import unittest
import time
import sleep
from TestUtils import TestUtilsMixin, ACCUMULO_DIR
log = logging.getLogger('test.auto')
from simple.readwrite import SunnyDayTest, Interleaved
from simple.delete import DeleteTest
class ChaoticBalancerIntegrity(SunnyDayTest):
"""Start a new table, cr... |
from collections import Counter
def load(f):
return f.read()
def count(content):
return Counter(content.lower().split())
def asc(words):
return sorted(words.items())
def top(words, qty=20):
return words.most_common(qty)
def lines(words):
lines_ = ('{}\t\t{}'.format(*t) for t in words)
return '\n... |
square = lambda n: n * n
def test_square_equals(arg, expected):
observed = square(arg)
if observed == expected:
print('Thumbs up.')
else:
print('Thumbs down. Expected %i but got %i' % (expected, observed))
test_square_equals(0, 0)
test_square_equals(1, 1)
test_square_equals(2, 4)
test_square_equals(3, 9) |
import tvm
import numpy as np
def test_get_global():
targs = (10, 10.0, "hello")
# register into global function table
@tvm.register_func
def my_packed_func(*args):
assert(tuple(args) == targs)
return 10
# get it out from global function table
f = tvm.get_global_func("my_packed_f... |
"""
Example Airflow DAG that demonstrates operators for the Google Cloud Video Intelligence service in the Google
Cloud Platform.
This DAG relies on the following OS environment variables:
* GCP_BUCKET_NAME - Google Cloud Storage bucket where the file exists.
"""
import os
from google.api_core.retry import Retry
import... |
"""Test the functionality of the build image from commit module.
The will consist of the following functional tests:
1. The inference of the main repo for a specific project.
2. The building of a projects fuzzers from a specific commit.
IMPORTANT: This test needs to be run with root privileges.
"""
import os
import... |
from math import log10
s = 0
for n in range(1, 10):
s += int(1 / (1 - log10(n)))
print(s) |
"""All the test files for API renderers plugins are imported here."""
from grr.gui.api_plugins import aff4_test
from grr.gui.api_plugins import artifact_test
from grr.gui.api_plugins import config_test
from grr.gui.api_plugins import hunt_test
from grr.gui.api_plugins import reflection_test
from grr.gui.api_plugins imp... |
"""
Unit tests for session management and API invocation classes.
"""
import mock
from oslo.vmware import api
from oslo.vmware import exceptions
from oslo.vmware import vim_util
from tests import base
class RetryDecoratorTest(base.TestCase):
"""Tests for retry decorator class."""
def test_retry(self):
r... |
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.AFOS.nonGrazingAnimals.Loads import NGLoadN
from gwlfe.enums import YesOrNo
class TestNGLoadN(VariableUnitTest):
def test_NGLoadN(self):
z = self.z
np.testing.assert_array_almost_equal(
NGLoadN.NGLoadN_f(z.Grazi... |
from . import registry
from . import http
from . import db
from . import ir_qweb
from . import bus
from . import lru |
"""MySQL Connector/Python version information
The file version.py gets installed and is available after installation
as mysql.connector.version.
"""
VERSION = (2, 0, 1, '', 0)
if VERSION[3] and VERSION[4]:
VERSION_TEXT = '{0}.{1}.{2}{3}{4}'.format(*VERSION)
else:
VERSION_TEXT = '{0}.{1}.{2}'.format(*VERSION[0:3... |
import numpy as np
import logging
import unittest
import os.path
import doctest
import pandas as pd
from fastlmm.association import single_snp
from fastlmm.association import single_snp_linreg
import pysnptools.util.pheno as pstpheno
from fastlmm.feature_selection.test import TestFeatureSelection
from fastlmm.util.runn... |
class TerminalClient(object):
def do(self, command, wait_for=None, include_last_line=False):
raise NotImplemented()
def send_key(self, key, wait_for=None, include_last_line=False):
raise NotImplemented()
def quit(self, command):
raise NotImplemented()
def get_current_prompt(self)... |
import sys
from GLUEInfoProvider import CommonUtils
def process(siteDefs, out=sys.stdout):
if siteDefs.creamStandAloneMode(siteDefs.ceHost):
return
now = CommonUtils.getNow()
out.write("dn: GLUE2ManagerId=%s_Manager,GLUE2ServiceID=%s,GLUE2GroupID=resource,o=glue\n"
% (siteDefs.co... |
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from libnacl import __version__ as version
extensions = [
'sphinx.ext.autodoc',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'libnacl'
copyright = u'2017, Thomas S Hatch'
release = version
exclude_patterns = [... |
BROKER_URL = 'amqp://localhost'
CELERY_RESULT_BACKEND = 'amqp'
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TIMEZONE = 'US/Pacific'
CELERY_ENABLE_UTC = True |
'''
Copyright 2013 Gordon McGregor
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... |
import argparse
from backtype.storm import Config, LocalCluster, StormSubmitter
from romper.topology import get_topology_builder
def main(run_local=False):
parser = argparse.ArgumentParser(description="Generate a single jar for Storm")
parser.add_argument("--local", default=run_local, action="store_true", help=... |
from __future__ import absolute_import, division, print_function, unicode_literals
JOB_ACCEPTED = 'job_accepted'
JOB_REJECTED = 'job_rejected'
JOB_FINISHED = 'job_finished'
JOB_FAILED = 'job_failed' |
from ..remote import RemoteModel
class DeviceGroupDefnRemote(RemoteModel):
"""
The device group criteria definitions. This is distinct from the evaluated device groups captured in the DeviceGroup API. One Device Group Definition may result in several Device Groups, one within each defined Network.
| ``Grou... |
""" Created by Max 10/4/2017 """
import sys
import pprint
from ID3Pruning import ID3Pruning
from customCsvReader import CustomCSVReader
from CrossValidation import CrossValidation
from decisionTree import ID3
def run_classification_experiment(data_set_path, learner, pruner, pruning=False, data_type=float):
"""
... |
"""Fastboot in python.
Call it similar to how you call android's fastboot. Call it similar to how you
call android's fastboot, but this only accepts usb paths and no serials.
"""
import argparse
import inspect
import logging
import sys
from adb import common_cli
from adb import fastboot
try:
import progressbar
exce... |
"""Tests for control_flow_ops.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from absl.testing import parameterized
import numpy as np
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import node_def_pb... |
from __future__ import absolute_import, print_function, division
import os
import json
try:
# Py3k
from html.parser import HTMLParser
except ImportError:
# Py2.7
from HTMLParser import HTMLParser
from pelican import signals
from pelican.readers import MarkdownReader, HTMLReader, BaseReader
from .ipynb i... |
import sys
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor, CellExecutionError
import os
import errno
from notebook_processors import RemoveNoExecuteCells, UpdateVariablesPreprocessor
from typing import Dict
import papermill as pm
def execute_notebook(
notebook_file_path: str, output_file_fo... |
from neutron.api import extensions
from neutron import manager
from neutron import wsgi
from oslo_log import log as logging
import quark.utils as utils
RESOURCE_NAME = 'route'
RESOURCE_COLLECTION = RESOURCE_NAME + "s"
EXTENDED_ATTRIBUTES_2_0 = {
RESOURCE_COLLECTION: {}
}
attr_dict = EXTENDED_ATTRIBUTES_2_0[RESOURCE... |
import sqlite3
import ClientAPI
import MailboxAPI
def InitializeDatabase():
conn = sqlite3.connect('Emailbox.db')
cursor = conn.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS CLIENTS
(
ID INTEGER PRIMARY KEY AUTOINCREMENT,
FLOOR INTE... |
"""
Copyright 2015 Ericsson AB
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 distr... |
import twistedcaldav.test.util
from twistedcaldav.ical import Component
from twistedcaldav.datafilters.peruserdata import PerUserDataFilter
from twistedcaldav.timezones import TimezoneCache
dataForTwoUsers = """BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
BEGIN:VEVENT
UID:12345-67890
... |
"""
This script exports Terasology block shapes from Blender. These are exported as as .groovy files.
Each block should be centered on the origin, and contain sub meshes with the following names:
- Center
- Top
- Bottom
- Front
- Back
- Left
- Right
Each side can be given a custom property of "teraFullSide" to d... |
__all__ = [
'run',
]
from oslo_concurrency import lockutils
from oslo_log import log as logging
from oslo_utils import encodeutils
from oslo_utils import excutils
import six
from glance.api.v2 import images as v2_api
from glance.common import exception
from glance.common.scripts import utils as script_utils
from gl... |
"""Module for testing the del rack command."""
import unittest
if __name__ == "__main__":
import utils
utils.import_depends()
from brokertest import TestBrokerCommand
class TestDelRack(TestBrokerCommand):
def test_100_del_ut3(self):
command = "del rack --rack ut3"
self.noouttest(command.spli... |
"""Dataset utilities for vision tasks using TFDS and tf.data.Dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import Any, List, Optional, Tuple, Mapping, Union
from absl import logging
from dataclasses import dataclass
import ... |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2015-2018 ARM Limited
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... |
import subprocess, os.path
from ..mesonlib import EnvironmentException, Popen_safe
from .compilers import Compiler, rust_buildtype_args
class RustCompiler(Compiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None):
self.language = 'rust'
super().__init__(exelist, version)
se... |
"""
Performs identification test and report p-values
"""
from collections import defaultdict
from Bio import SeqIO
import numpy as np
from nanoalign.identifier import Identifier
from nanoalign.blockade import read_mat
import nanoalign.signal_proc as sp
def _make_database(db_file, peptide):
"""
Reads protein dat... |
CP = (
(u"CABA", u"RECOLETA, CABA - C1119"),
(u"22 DE MAYO", u"22 DE MAYO - S2124XAD"),
(u"4 DE FEBRERO", u"4 DE FEBRERO - S2732XAA"),
(u"AARÓN CASTELLANOS", u"AARÓN CASTELLANOS - S6106"),
(u"ABIPONES", u"ABIPONES - S3042XAA"),
(u"ACEBAL", u"ACEBAL - S2109"),
(u"ACHAVAL RODRIGUEZ", u"ACHAVAL RODRIGUEZ - S... |
import base64
import logging
from django.conf import settings as django_settings
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import redirect
try:
from django.utils.http import url_has_allowed_host_and_scheme
except ImportError:
# Django <3.0
from django.utils.http impor... |
from .. import Availability, Class, Constant, Define, Method, Parameter, Type
gx_class = Class('FFT2',
doc="""
2-D Fast Fourier Transforms
These methods now work with an :class:`IMG` object, instead of creating
their own :class:`FFT2` object.
... |
"""Application of convolution networks using Lasagne and Kerasr"""
import os
import numpy as np
import lasagne
from lasagne import layers
from lasagne.updates import nesterov_momentum
from nolearn.lasagne import NeuralNet
import progressbar
__author__ = "Peter J Usherwood"
__python_version__ = "3.6"
class AgeClassifier... |
'''Container classes for feature analysis'''
import numpy as np
import pandas as pd
import six
from .timing import TimeSlice
from .exceptions import FeatureError
class Feature(object):
"""
Core feature container object. Handles indexing and time-slicing.
Attributes
---------
Methods
------
... |
import threading
from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from inline_ordering.models import Orderable
from filer.fields.image import FilerImageField
import utils
localdata = threading.local()
localdata.TEMPLATE_CHOICES = utils.autodiscover_te... |
import logging
import angr
import pyvex
import claripy
from angr.errors import SimEngineError, SimMemoryError
from . import rop_utils
from .rop_gadget import RopGadget, RopMemAccess, RopRegMove, StackPivot
from .errors import RopException, RegNotFoundException
l = logging.getLogger("angrop.gadget_analyzer")
class Gadge... |
from jsonlogging.tests.test_dictconfig import *
from jsonlogging.tests.test_formatters import *
from jsonlogging.tests.test_jsonlogging import *
from jsonlogging.tests.test_record_adapter import *
from jsonlogging.tests.test_values import * |
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import shutil
import numpy as np
import numpy.testing as nt
import healpy as hp
from ..tod.tod import *
from ..tod.pointing import *
from ..tod.sim_tod import *
from ..tod.sim_det_noise import *
from ..tod.sim_noise import *
from ..map import *
fro... |
"""
This module contains logic that processes security group rules for a VPC
"""
import logging
from boto.exception import EC2ResponseError
from .exceptions import VPCEnvironmentError
from .resource_helper import keep_trying, throttled_call
logger = logging.getLogger(__name__)
class DiscoVPCSecurityGroupRules(object):
... |
from flask import redirect, render_template, render_template_string, Blueprint
from flask import request, url_for
from flask_user import current_user, login_required, roles_accepted
from app import app, db
from models import Microapp
from app.core.models import UserProfileForm
core_blueprint = Blueprint('core', __name_... |
import angr
import logging
l = logging.getLogger(name=__name__)
class fflush(angr.SimProcedure):
#pylint:disable=arguments-differ,unused-argument
def run(self, fd):
return self.state.solver.BVV(0, self.state.arch.bits) |
import raspberrypi
from compass_CMPS10 import Cmps10_Sensor
if __name__ == "__main__":
print "Testing compass sensor..."
compassSensor = Cmps10_Sensor(interface=raspberrypi.i2c_bus(), debug=True)
# heading
(heading, pitch, roll) = compassSensor.read_sensor()
print "Heading %f, pitch %f, roll %f" % (... |
'''
Wrapper around a dict of pages for some extra functionality. Only intended to
be used internally.
'''
from Cap import Cap
from Object import ASIDPool, PageDirectory, Frame, PageTable
from Spec import Spec
from util import page_table_vaddr, page_table_index, page_index, round_down, \
PAGE_SIZE
import collections... |
from __future__ import division
import math
import numpy as np
from ndhist.core import generic_axis, linear_axis, log10_axis
def linear(start, stop
, width=1
, label=''
, name=''
, add_underflow_bin=True
, add_overflow_bin=True
, extend=False
, extracap=0
):
"""Creates a linear axis with bins in the r... |
"""
Author: Isabel Restrepo
May 2, 2012
A script to parse training features from all categories and stack them into a singe array
"""
if __name__=="__main__":
import os
import sys
import time
import numpy as np
from bmvc12_adaptor import *
from sklearn.cluster import MiniBatchKMeans
from sklearn.externals... |
import os
os.environ['XPDAN_SETUP'] = str(0) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.