code
stringlengths
1
199k
from flask import session from werkzeug.exceptions import Forbidden from indico.modules.rb.controllers import RHRoomBookingBase from indico.modules.rb.util import rb_is_admin from indico.util.i18n import _ class RHRoomBookingAdminBase(RHRoomBookingBase): """ Adds admin authorization. All classes that implement ...
from __future__ import unicode_literals def serialize_ip_network_group(group): """Serialize group to JSON-like object""" return { 'id': group.id, 'name': group.name, 'identifier': 'IPNetworkGroup:{}'.format(group.id), '_type': 'IPNetworkGroup' }
''' NFI -- Silensec's Nyuki Forensics Investigator Copyright (C) 2014 George Nicolaou (george[at]silensec[dot]com) Silensec Ltd. Juma Fredrick (j.fredrick[at]silensec[dot]com) Silensec Ltd. This file is part of Nyuki Forensics Investigator (NFI). NFI is free ...
import argparse import os.path import sqlite3 import sys path = os.path.dirname(str(__file__, sys.getfilesystemencoding())) sys.path.append(os.path.realpath(os.path.join(path, ".."))) rename_phrase = " is now known as " conversion_phrase = " is being converted to " text = """Partial Weapon Navigation is being converted...
""" This file is part of OpenSesame. OpenSesame 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. OpenSesame is distributed in the hope that it...
""" This code will fail at runtime... Could you help `mypy` catching the problem at compile time? """ def sum_numbers(*n) -> float: """Sums up any number of numbers""" return sum(n) if __name__ == '__main__': sum_numbers(1, 2.0) # this is not a bug sum_numbers('4', 5) # this is a bug - can `mypy` catc...
""" Microsoft Windows Help (HLP) parser for Hachoir project. Documents: - Windows Help File Format / Annotation File Format / SHG and MRB File Format written by M. Winterhoff (100326.2776@compuserve.com) found on http://www.wotsit.org/ Author: Victor Stinner Creation date: 2007-09-03 """ from hachoir_py3.parser imp...
import abc import logging from datetime import datetime from typing import Any, ClassVar, Dict import tinydb logger = logging.getLogger(__name__) class Migration(metaclass=abc.ABCMeta): """Migrates schema from <SCHEMA_VERSION-1> to <SCHEMA_VERSION>.""" SCHEMA_VERSION: ClassVar[int] = 0 def __init__(self, *,...
from .utils.dataIO import fileIO from .utils import checks from __main__ import send_cmd_help from __main__ import settings as bot_settings from operator import itemgetter, attrgetter import discord from discord.ext import commands import aiohttp import asyncio import json import os import http.client DIR_DATA = "data/...
class Charset(object): common_name = 'NotoSansSylotiNagri-Regular' native_name = '' def glyphs(self): glyphs = [] glyphs.append(0x0039) #glyph00057 glyphs.append(0x0034) #uniA82A glyphs.append(0x0035) #uniA82B glyphs.append(0x0036) #glyph00054 glyphs.appen...
from __future__ import absolute_import, division, unicode_literals from jx_base.queries import get_property_name from jx_sqlite.utils import GUID, untyped_column from mo_dots import concat_field, relative_field, set_default, startswith_field from mo_json import EXISTS, OBJECT, STRUCT from mo_logs import Log class Schem...
"""bug 993786 - update_crash_adu_by_build_signature-bad-buildids Revision ID: 21e4e35689f6 Revises: 224f0fda6ecb Create Date: 2014-04-08 18:46:19.755028 """ revision = '21e4e35689f6' down_revision = '224f0fda6ecb' from alembic import op from socorrolib.lib import citexttype, jsontype, buildtype from socorrolib.lib.migr...
import frappe from frappe.utils import get_fullname def execute(): for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee` where ifnull(user_id, '')!='' group by user_id having count(name) > 1"""): fullname = get_fullname(user_id) employee = frappe.db.get_value("Employee", {"employee_na...
import datetime from openerp.exceptions import AccessError from openerp.osv import osv, fields class res_partner(osv.Model): _inherit = 'res.partner' # # add related fields to test them # _columns = { # a regular one 'related_company_partner_id': fields.related( 'company_...
from django.core.exceptions import MultipleObjectsReturned from django.shortcuts import redirect from django.urls import reverse, path from wagtail.api.v2.router import WagtailAPIRouter from wagtail.api.v2.views import PagesAPIViewSet, BaseAPIViewSet from wagtail.images.api.v2.views import ImagesAPIViewSet from wagtail...
def get_ip_address(request): ip_address = request.META.get('HTTP_X_FORWARDED_FOR') if ip_address: return ip_address.split(',')[-1] return request.META.get('REMOTE_ADDR')
from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.http.response import HttpResponseNotFound from shuup.xtheme._theme import get_current_theme _VIEW_CACHE = {} def clear_view_cache(**kwargs): _VIEW_CACHE.clear() setting_changed.connect(clear_view_cach...
import sys import os import grass.script as grass grass.run_command("g.gisenv", set="OVERWRITE=1") grass.message(_("Set the region")) grass.run_command("g.region", res=50, n=950, s=0, w=0, e=2000) grass.run_command("r.mapcalc", expression="phead= if(row() == 19, 5, 3)") grass.run_command("r.mapcalc", expression="status...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.contrib.auth.models import User from django.template.loader import render_to_string from django.conf import settings from django.contrib.sites.models import Site from django.core.urlresolve...
''' Created on 2013-11-25 @author: Martin H. Bramwell ''' import oerplib import sys import socket from models.OErpModel import OErpModel class OpenERP(object): def __init__(self, credentials): db = credentials['db_name'] user_id = credentials['user_id'] host_name = credentials['host_name'] ...
"""Test behaviour of the test running and the term program interaction.""" import sys import pexpect from testrunner import run def _shellping(child, timeout=1): """Issue a 'shellping' command. Raises a pexpect exception on failure. :param timeout: timeout for the answer """ child.sendline('shellpin...
import os, sys from PyQt4.QtCore import * from PyQt4.QtGui import * class CustomWidget(QWidget): def __init__(self, parent, fake = False): QWidget.__init__(self, parent) gradient = QLinearGradient(QPointF(0, 0), QPointF(100.0, 100.0)) baseColor = QColor(0xa6, 0xce, 0x39, 0x7f) gradie...
def f(): delay_mu(2) def g(): delay_mu(2) x = f if True else g def h(): with interleave: f() # CHECK-L: ${LINE:+1}: fatal: it is not possible to interleave this function call within a 'with interleave:' statement because the compiler could not prove that the same function would always be cal...
import re from lilac.controller import ADMIN, LOGGER from lilac.orm import Backend from lilac.tool import access, set_secure_cookie from lilac.model import User from solo.template import render_template from solo.web.util import jsonify from solo.web import ctx from webob import exc from lilac.paginator import Paginat...
from .module import RegionsjobModule __all__ = ['RegionsjobModule']
""" Module for converting various mesh formats.""" from __future__ import print_function import getopt import sys from instant import get_status_output import re import warnings import os.path import numpy import six from . import abaqus from . import xml_writer def format_from_suffix(suffix): "Return format for gi...
import gc from concurrent.futures import ThreadPoolExecutor import pandas as pd import numpy as np import os import arboretum import json import sklearn.metrics from sklearn.metrics import f1_score, roc_auc_score from sklearn.model_selection import train_test_split from scipy.sparse import dok_matrix, coo_matrix from s...
from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import sys requires = [] if sys.platform != 'win32' and sys.platform != 'darwin': requires.append('spidev') setup(name = 'Adafruit_GPIO', version = '0.8.0', author = 'Tony D...
import sys import os import math import numpy as np import pandas as pd from pandas.tools.plotting import table import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def usage(): print 'Usage: slope_histogram_cumulative_graph.py -name "InSight E1" slope_histogram_table.tab outfile.png' print "...
"""Domain objects for classifier models""" import copy class Classifier(object): """Domain object for a classifier. A classifier is a machine learning model created using a particular classification algorithm which is used for answer classification task. Attributes: id: str. The unique id of...
from __future__ import print_function from time import sleep from bcc import BPF import argparse import multiprocessing import os import subprocess def valid_args_list(args): args_list = args.split(",") for arg in args_list: try: int(arg) except: raise argparse.ArgumentTy...
import collections import contextlib import mock from neutron.openstack.common import importutils import neutron.plugins.ofagent.agent.metadata as meta from neutron.tests.unit.ofagent import ofa_test_base _OFALIB_NAME = 'neutron.plugins.ofagent.agent.arp_lib' class OFAAgentTestCase(ofa_test_base.OFAAgentTestBase): ...
"""Test deCONZ gateway.""" from unittest.mock import Mock, patch import pytest from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.components.deconz import errors, gateway from tests.common import mock_coro import pydeconz ENTRY_CONFIG = { "host": "1.2.3.4", "port": 80, "api_key": "1...
"""Support for Freedompro sensor.""" from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorStateClass, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import LIGHT_LUX, PERCENTAGE, TEMP_CELSIUS from homeassistant.core import HomeAssistant, callb...
"""Unit test for treadmill.appcfg.configure. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import shutil import sys import tempfile import unittest import mock import treadmill from treadmill.appcfg impo...
""" Simple screensaver that displays data from a URL. See additional information in the class itself. The screen class available here is: * `UrlFetcherScreen` """ from termsaverlib.screen.base.urlfetcher import UrlFetcherBase from termsaverlib import constants from termsaverlib.i18n import _ class UrlFetcherScreen(...
""" This file contains the random number generating methods used in the framework. created on 07/15/2017 @author: talbpaul """ from __future__ import division, print_function, unicode_literals, absolute_import import sys import math import threading from collections import deque, defaultdict import numpy as np from ...
""" mbed SDK Copyright (c) 2011-2013 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 or agreed to in writi...
"""GradingRecord (Model) query functions. """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', ] from google.appengine.ext import db from soc.logic.models import base from soc.modules.gsoc.logic.models.survey_record import grading_logic from soc.modules.gsoc.logic.models.survey_record import project_logic...
""" Copyright (c) 2015 SONATA-NFV ALL RIGHTS RESERVED. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
__author__ = 'Brian Wickman' from process_provider_ps import ProcessProvider_PS from process_provider_procfs import ProcessProvider_Procfs class ProcessProviderFactory(object): """ A factory for producing platform-appropriate ProcessProviders. Typical use-cases: Import >>> from twitter.common.proc...
import time from datetime import datetime def format_ts_from_float(ts): return int(ts) * 1000000000 def format_ts_from_date(ts): return format_ts_from_float(time.mktime(ts.timetuple())) def format_ts_from_str(ts, pattern='%Y-%m-%d %H:%M:%S'): return format_ts_from_date(datetime.strptime(ts, pattern)) def fo...
"""Handle automations.""" import logging from collections import deque from functools import partial import voluptuous as vol from camacq.exceptions import TemplateError from camacq.helper import BASE_ACTION_SCHEMA, get_module, has_at_least_one_key from camacq.helper.template import make_template, render_template from ...
"""Helper methods to handle the time in Home Assistant.""" from __future__ import annotations from contextlib import suppress import datetime as dt import re from typing import Any, cast import ciso8601 import pytz import pytz.exceptions as pytzexceptions import pytz.tzinfo as pytzinfo from homeassistant.const import M...
from typing import Any, Dict, List, Set, Tuple from marshmallow import Schema from sqlalchemy.orm import Session from sqlalchemy.sql import select from superset.charts.commands.importers.v1.utils import import_chart from superset.charts.schemas import ImportV1ChartSchema from superset.commands.importers.v1 import Impor...
from __future__ import absolute_import from __future__ import print_function import importlib import os import six import ujson import django.core.urlresolvers from django.test import TestCase from typing import List, Optional from zerver.lib.test_classes import ZulipTestCase from zerver.models import Stream from zproj...
import contextlib from eventlet import greenthread import mock from mox3 import mox import os_xenapi from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import fixture as config_fixture from oslo_utils import fixture as utils_fixture from oslo_utils import timeutils from os...
"""Module implementing RNN Cells. This module provides a number of basic commonly used RNN cells, such as LSTM (Long Short Term Memory) or GRU (Gated Recurrent Unit), and a number of operators that allow adding dropouts, projections, or embeddings for inputs. Constructing multi-layer cells is supported by the class `Mu...
""" OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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/L...
from a10sdk.common.A10BaseClass import A10BaseClass class VeCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param ve_end: {"type": "number", "description": "VE port", "format": "number"} :param ve_start: {"type": "number", "description": "VE port (VE Interface number)",...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0015_auto_20150819_1501'), ] operations = [ migrations.AlterField( model_name='apikey', name='private_key', ...
from django.conf import settings from django.core import mail from rdmo.core.mail import send_mail def test_send_mail(db): send_mail('Subject', 'Message', to=['user@example.com']) assert len(mail.outbox) == 1 assert mail.outbox[0].subject == '[example.com] Subject' assert mail.outbox[0].body == 'Message...
import copy import inspect import logging import typing # noqa (use mypy typing) import unittest import uuid from torment import fixtures from torment import contexts logger = logging.getLogger(__name__) class FixturesCreateUnitTest(unittest.TestCase): def test_fixture_create_without_context(self) -> None: ...
""" Docker shell helper class module. """ from __future__ import unicode_literals, absolute_import from __future__ import print_function, division from topology.platforms.shell import PExpectShell, PExpectBashShell class DockerExecMixin(object): """ Docker ``exec`` connection mixin for the Topology shell API. ...
''' Bundle a context and its packages into a relocatable dir. ''' from __future__ import print_function import os import os.path import sys def setup_parser(parser, completions=False): group = parser.add_mutually_exclusive_group() group.add_argument( "-s", "--skip-non-relocatable", action="store_true", ...
import array import unittest from shutil import rmtree import os from swift.common import ring, ondisk from swift.common.utils import json from swift.common.swob import Request, Response from swift.common.middleware import list_endpoints class FakeApp(object): def __call__(self, env, start_response): return...
"""Control flow graph analysis. Given a Python AST we construct a control flow graph, with edges both to the next and previous statements (so it can easily walk the graph both ways). Its nodes contain the AST of the statements. It can then perform forward or backward analysis on this CFG. """ from __future__ import abs...
import os import base64 from datetime import datetime from xos.config import Config from xos.logger import Logger, logging from synchronizers.base.steps import * from django.db.models import F, Q from core.models import * from django.db import reset_queries from synchronizers.base.ansible import * from generate.depende...
import os import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def make_conv_bn_relu(in_channels, out_channels, kernel_size=3, stride=1, padding=1, groups=1): return [ nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size, stride=stride, p...
""" Protocol Buffer Breaking Change Detector This tool is used to detect "breaking changes" in protobuf files, to ensure proper backwards-compatibility in protobuf API updates. The tool can check for breaking changes of a single API by taking 2 .proto file paths as input (before and after) and outputting a bool `is_bre...
''' Appendix F. Grid Mappings --- Each recognized grid mapping is described in one of the sections below. Each section contains: the valid name that is used with the grid_mapping_name attribute; a list of the specific attributes that may be used to assign values to the mapping's parameters; the standard names used to i...
import unittest from iptest.type_util import * from iptest import run_test class ComplexTest(unittest.TestCase): def test_from_string(self): # complex from string: negative # - space related l = ['1.2', '.3', '4e3', '.3e-4', "0.031"] for x in l: for y in l: ...
from txamqp.client import Closed from txamqp.queue import Empty from txamqp.content import Content from txamqp.testlib import TestBase, supportedBrokers, QPID, OPENAMQ from twisted.internet.defer import inlineCallbacks class ASaslPlainAuthenticationTest(TestBase): """Test for SASL PLAIN authentication Broker functi...
"""Set of classes and functions for dealing with dates and timestamps. The BaseTimestamp and Timestamp are timezone-aware wrappers around Python datetime.datetime class. """ import calendar import copy import datetime import re import sys import time import types import warnings from dateutil import parser import pytz ...
from oslo_config import cfg glance_client = cfg.OptGroup(name='glance_client', title='Configuration Options for Glance') GLANCE_CLIENT_OPTS = [ cfg.StrOpt('api_version', default='2', help='Version of Glance API to use in glanceclient.'), cfg.StrOpt('end...
import copy import os.path import eventlet import fixtures import mock import netaddr from neutron_lib import constants as lib_const from oslo_config import fixture as fixture_config from oslo_utils import uuidutils from neutron.agent.common import ovs_lib from neutron.agent.dhcp import agent from neutron.agent import ...
"""Unit tests.""" import mock import pytest from google.api import metric_pb2 as api_metric_pb2 from google.api import monitored_resource_pb2 from google.cloud import monitoring_v3 from google.cloud.monitoring_v3 import enums from google.cloud.monitoring_v3.proto import common_pb2 from google.cloud.monitoring_v3.proto ...
import xml.etree.ElementTree as ET class brocade_aaa(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def aaa_config_aaa_authentication_login_first(self, **kwargs): """Auto Generated Code """ config = ET.Element("...
import os import random import string import unittest import requests from tethys_dataset_services.engines import CkanDatasetEngine try: from tethys_dataset_services.tests.test_config import TEST_CKAN_DATASET_SERVICE except ImportError: print('ERROR: To perform tests, you must create a file in the "tests" packa...
import setuptools setuptools.setup( name="sirius", version="0.5", author="", author_email="simon.pintarelli@cscs.ch", description="pySIRIUS", url="https://github.com/electronic_structure/SIRIUS", packages=['sirius'], install_requires=['mpi4py', 'voluptuous', 'numpy', 'h5py', 'scipy', 'Py...
''' Copyright (c) 2013-2014, Joshua Pitts All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
""" Program for generating plantuml or dot format of a database tables by connection string \n\nDatabase connection string - http://goo.gl/3GpnE """ import operator import string from optparse import OptionParser from sqlalchemy import create_engine, MetaData from tsadisplay import describe, render, __version__ def run...
from __future__ import annotations import re import sys from typing import Any, Callable, TypeVar from pathlib import Path import numpy as np import numpy.typing as npt AR_f8: npt.NDArray[np.float64] AR_i8: npt.NDArray[np.int64] bool_obj: bool suppress_obj: np.testing.suppress_warnings FT = TypeVar("FT", bound=Callable...
import logging, os, sys l = logging.getLogger(__name__) from django.conf import settings import json from django_lean.experiments.models import Experiment class ExperimentLoader(object): """ Loads the experiments from a file containing a list of experiment It will add new experiments, but not touch existing...
import sys import requests try: from .helper import * except SystemError: from helper import * def compareRequestsAndSelenium(url): html1 = str(requests.get(url).text) try: driver = webdriver.Firefox() driver.maximize_window() driver.get(url) html2 = str(driver.page_sourc...
""" Simple utility code for animations. """ import types from functools import wraps try: from decorator import decorator HAS_DECORATOR = True except ImportError: HAS_DECORATOR = False from pyface.timer.api import Timer from traits.api import HasTraits, Button, Instance, Range from traitsui.api import View,...
"""Package that handles non-debug, non-file output for run-webkit-tests.""" import math import optparse from webkitpy.tool import grammar from webkitpy.layout_tests.models import test_expectations from webkitpy.layout_tests.models.test_expectations import TestExpectations, TestExpectationParser from webkitpy.layout_tes...
import pytest from diofant import Integer, SympifyError from diofant.core.operations import AssocOp, LatticeOp __all__ = () class MyMul(AssocOp): identity = Integer(1) def test_flatten(): assert MyMul(2, MyMul(4, 3)) == MyMul(2, 4, 3) class Join(LatticeOp): """Simplest possible Lattice class.""" zero = ...
from nose.tools import eq_ from elasticutils import MLT from elasticutils.tests import ESTestCase class MoreLikeThisTest(ESTestCase): data = [ {'id': 1, 'foo': 'bar', 'tag': 'awesome'}, {'id': 2, 'foo': 'bar', 'tag': 'boring'}, {'id': 3, 'foo': 'bar', 'tag': 'awesome'}, {'id': 4, 'fo...
""" Logistic Regression """ import numbers import warnings import numpy as np from scipy import optimize, sparse from .base import LinearClassifierMixin, SparseCoefMixin, BaseEstimator from ..feature_selection.from_model import _LearntSelectorMixin from ..preprocessing import LabelEncoder from ..svm.base import BaseLib...
""" Tera Python SDK. It needs a libtera_c.so TODO(taocipian) __init__.py """ from ctypes import CFUNCTYPE, POINTER from ctypes import byref, cdll, string_at from ctypes import c_bool, c_char_p, c_void_p from ctypes import c_uint32, c_int32, c_int64, c_ubyte, c_uint64 class Status(object): """ status code """ # ...
import sys import os.path import optparse import cascadenik sys.path.append(os.path.dirname(os.path.realpath(__file__))) from cssutils.tokenize2 import Tokenizer as cssTokenizer def main(filename): """ Given an input file containing nothing but styles, print out an unrolled list of declarations in cascade o...
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from olympia.constants.applications import ( ANDROID, FIREFOX, SEAMONKEY, THUNDERBIRD) from olympia.constants.base import ( ADDON_DICT, ADDON_EXTENSION, ADDON_LPAPP, ADDON_PERSONA, ADDON_SEARCH, ADDON_SLUGS,...
import contextlib from directed_edge import Exporter, Item from .utils import ident, get_database @contextlib.contextmanager def get_exporter(target=None): if target is None: target = get_database() exporter = DjangoExporter(target) yield exporter exporter.finish() class DjangoExporter(Exporter)...
"""Lite version of scipy.linalg. Notes ----- This module is a lite version of the linalg.py module in SciPy which contains high-level Python interface to the LAPACK library. The lite version only accesses the following LAPACK functions: dgesv, zgesv, dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetrf...
from datetime import datetime, date, time from HTMLParser import HTMLParser import random import urllib2 from django.conf import settings from django.db import transaction from django.db.models import Q from django.utils import timezone from icalendar import Calendar import pytz from wprevents.events.models import Even...
import sqlalchemy as sa from sqlalchemy_utils import get_query_entities from tests import TestCase class TestGetQueryEntities(TestCase): def create_models(self): class TextItem(self.Base): __tablename__ = 'text_item' id = sa.Column(sa.Integer, primary_key=True) type = sa....
from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand from django.contrib.contenttypes.models import ContentType from django.utils.importlib import import_module import yaml import os.path from scholrroles.models import Role, Permission class Command(BaseC...
""" __init__.py Created by Thomas Mangin on 2010-01-15. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """
""" SOM-based learning functions for CFProjections. """ from math import ceil import param from imagen import PatternGenerator, Gaussian from holoviews import BoundingBox from topo.base.arrayutil import L2norm, array_argmax from topo.base.cf import CFPLearningFn class CFPLF_SOM(CFPLearningFn): """ An abstract b...
from unittest import mock from urllib.error import HTTPError, URLError import requests from azure.mgmt.cdn import CdnManagementClient from azure.mgmt.frontdoor import FrontDoorManagementClient from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override...
"""Some system-specific info for cyclus.""" import sys import importlib from cyclus.lazyasd import lazyobject @lazyobject def PY_VERSION_TUPLE(): return sys.version_info[:3] @lazyobject def curio(): if PY_VERSION_TUPLE < (3, 5, 2): return None else: try: return importlib.import_m...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('main', '0012_auto_20160204_1503'), ] operations = [ migrations.AlterModelOptions( name='eventassignment', options={'permissions':...
import unittest import logging from tests.test_source import SourceTestCase from dipper.sources.HGNC import HGNC logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) class HGNCTestCase(SourceTestCase): def setUp(self): self.source = HGNC('rdf_graph', True) self.source.test...
import warnings from . import _harwell_boeing __all__ = [ # noqa: F822 'MalformedHeader', 'hb_read', 'hb_write', 'HBInfo', 'HBFile', 'HBMatrixType', 'FortranFormatParser', 'IntFormat', 'ExpFormat', 'BadFortranFormat' ] def __dir__(): return __all__ def __getattr__(name): if name not in __all__: ...
from iRODSLibrary import iRODSLibrary __version__ = "0.0.4" class iRODSLibrary(iRODSLibrary): """ iRODSLibrary is a client keyword library that uses the python-irodsclient module from iRODS https://github.com/irods/python-irodsclient Examples: | Connect To Grid | iPlant | data.iplantcollabor...
from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from numpy import atleast_1d, atleast_2d from .flinalg import get_flinalg_funcs from .lapack import get_lapack_funcs, _compute_lwork from .misc import LinAlgError, _datacopied, LinAlgWarning from .decomp import...
names = [ # NOQA 'Aan', 'Aalia', 'Aaliah', 'Aaliyah', 'Aaron', 'Aaryanna', 'Aavree', 'Abbie', 'Abbott', 'Abbra', 'Abby', 'Abe', 'Abel', 'Abelardo', 'Abeni', 'Abia', 'Abiba', 'Abie', 'Abigail', 'Abner', 'Abraham', 'Abram', 'Abrial', 'Abrianna', 'Abrienda', 'Abril', 'Abryl', 'Absolom', 'Abu', 'Acacia', 'Acadia', 'Ace', ...
from django.contrib import admin from .models import * admin.site.register(MessageInWaiting) admin.site.register(ResponseInWaiting) admin.site.register(Template)
''' ''' from __future__ import absolute_import, division, print_function, unicode_literals import logging log = logging.getLogger(__name__) from ..core.templates import DOC_NB_JS from ..core.json_encoder import serialize_json from ..model import Model from ..util.string import encode_utf8 from .elements import div_for_...