gt
stringclasses
1 value
context
stringlengths
2.49k
119k
#!/usr/bin/env python """Tests for the access control mechanisms.""" from grr.lib import access_control from grr.lib import aff4 from grr.lib import config_lib from grr.lib import data_store from grr.lib import email_alerts from grr.lib import flags from grr.lib import flow from grr.lib import hunts from grr.lib impo...
# util/langhelpers.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Routines to help with the creation, loading and introspection of modules, class...
# -*- coding: utf-8 -*- """ Functions to generate spike trains from analog signals, or to generate random spike trains. Some functions are based on the NeuroTools stgen module, which was mostly written by Eilif Muller, or from the NeuroTools signals.analogs module. :copyright: Copyright 2015 by the Elephant team, see...
from nutils.testing import * import nutils.types import inspect, pickle, itertools, ctypes, stringly, tempfile, io, os import numpy class apply_annotations(TestCase): def test_without_annotations(self): @nutils.types.apply_annotations def f(a, b): return a, b a, b = f(1, 2) self.assertEqual(a,...
# # Copyright (c) 2013, Digium, Inc. # """Code for handling the base Swagger API model. """ import json import os import urllib import urlparse from swaggerpy.http_client import SynchronousHttpClient from swaggerpy.processors import SwaggerProcessor, SwaggerError SWAGGER_VERSIONS = ["1.1", "1.2"] SWAGGER_PRIMITIV...
"""The feature extraction module contains classes for feature extraction.""" import numpy as np import SimpleITK as sitk import mialab.filtering.filter as fltr class AtlasCoordinates(fltr.IFilter): """Represents an atlas coordinates feature extractor.""" def __init__(self): """Initializes a new inst...
#!/bin/env python # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
# Copyright 2016 F5 Networks Inc. # # 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...
''' Entry point module to start the interactive console. ''' from _pydev_imps._pydev_thread import start_new_thread try: from code import InteractiveConsole except ImportError: from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole from code import compile_command from code import Inte...
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import gyp import gyp.common import gyp.SCons as SCons import os.path import pprint import re # TODO: remove when we delete the last WriteList() call in this mo...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.college' db.add_column(u'catalog_userprofile'...
import functools import logging import mimetypes import os import datetime import re from datetime import timedelta from django.conf import settings from django.contrib.sessions.middleware import SessionMiddleware from django.core.exceptions import MiddlewareNotUsed from django.http import HttpResponseRedirect from dj...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Name: test_euvatid # Purpose: Test driver for module euvatid # # Author: Michael Amrhein (michael@adrhinum.de) # # Copyright: (c) 2017 Michael Amrhein # License: This program is part of a large...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import multiprocessing import argparse from .. import __version__, util def add_global_arguments(parser, suppress_defaults=True): # Suppressing defaults is needed in order to allow global # arguments both before and after subcommand. Only the ...
""" Input, output and printing. """ from argparse import ArgumentParser, HelpFormatter from contextlib import contextmanager from os import fstat from os.path import dirname, exists, join from textwrap import indent from numpy import (array, asscalar, get_printoptions, load, savez_compressed, set_pr...
import os import time import pytest import logging from collections import OrderedDict from distutils import dir_util from distutils.version import LooseVersion from cassandra import ConsistencyLevel, InvalidRequest from cassandra.query import SimpleStatement from cassandra.util import sortedset from dtest import Te...
from abc import ABCMeta, abstractmethod from __main__ import settings, botdata, httpgetter from .helpers import * from gtts import gTTS import urllib.request import disnake import re import os import random import html import requests import functools from concurrent.futures import ThreadPoolExecutor import logging log...
#Meeprommer commandline interface #By Zack Nelson #Project Home: #https://github.com/mkeller0815/MEEPROMMER #http://www.ichbinzustaendig.de/dev/meeprommer-en #Adapted to work with EEPROMDate programmer #By Svetlana Tovarisch import serial, sys, argparse, time # Parse command line arguments parser = argparse.Argument...
# -*- coding: utf-8 -*- import os import os.path import datetime import json import sqlite3 # Uses python-requests # http://docs.python-requests.org/en/latest/ import requests import requests.exceptions # Look at the X-Bin-Request-Count header and X-Bin-Max-Requests header # for how many requests you've made, and how...
from flask import ( Flask, flash, g, session, redirect, render_template, request, ) from flask.ext.mongoengine import MongoEngine import datetime import os import random app = Flask(__name__) app.config["MONGODB_SETTINGS"] = {'DB': 'furrypoll_2016'} app.config["SECRET_KEY"] = os.urandom(1...
# awsauth.py for Interoute Object Storage # See the repo: https://github.com/Interoute/object-storage-api # # Source for this file: https://pypi.python.org/pypi/requests-aws/0.1.8 # See also: https://github.com/tax/python-requests-aws # # This code provides a class S3Auth to generate authorisation data which can be use...
## A script for extracting info about the patients used in the analysis ## Load necessary modules from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') ##This call will only work if you are running python from the command line. ##If you are not running from the command line manually...
"""Config flow to configure Nest. This configuration flow supports two APIs: - The new Device Access program and the Smart Device Management API - The legacy nest API NestFlowHandler is an implementation of AbstractOAuth2FlowHandler with some overrides to support the old APIs auth flow. That is, for the new API ...
__file__ = 'IRI_v7' __date__ = '1/28/2016' __author__ = 'ABREZNIC' """ The MIT License (MIT) Copyright (c) 2016 Texas Department of Transportation Author: Adam Breznicky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), t...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # 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 o...
from ..java import ( Method as JavaMethod, opcodes as JavaOpcodes, ) from .blocks import Block from .opcodes import ALOAD_name, ASTORE_name, ICONST_val POSITIONAL_OR_KEYWORD = 1 VAR_POSITIONAL = 2 KEYWORD_ONLY = 3 VAR_KEYWORD = 4 CO_VARARGS = 0x0004 CO_VARKEYWORDS = 0x0008 class Method(Block): def __i...
import threading, time, cgi, os, re import configuration import helper_tools as ht from motes import motes import utils import sensor_data maybeIsInSubprocess = False forceInterrupt = False subprocessLock = threading.Lock() def emitCodeMansOS(code, config): with open(os.path.join("build", "main.c"), "w") as outFi...
''' EffectWidget ============ .. versionadded:: 1.9.0 This code is still experimental, and its API is subject to change in a future version. The :class:`EffectWidget` is able to apply a variety of fancy graphical effects to its children. It works by rendering to a series of :class:`~kivy.graphics.Fbo` instan...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
''' Helper functions for geometrical operations. ''' from __future__ import division import logging import tables as tb import numpy as np def get_plane_normal(direction_vector_1, direction_vector_2): ''' Normal vector of a plane. Plane is define by two non parallel direction vectors within the plane. ...
import unittest import pickle, copy import keyword import re import sys import gc import weakref from recordclass import make_dataclass, datatype, DataclassStorage from recordclass import dataobject, datatuple from recordclass import asdict, clsconfig, enable_gc _t = () _t1 = (1,) _o = object() headgc_size = sys.gets...
import os, sys, inspect import h5py import numpy as np import random import math import multiprocessing from Crypto.Random.random import randint import gc import resource # Visualization import matplotlib import matplotlib.pyplot as plt from PIL import Image # from mayavi import mlab # from mayavi.core.ui.mayavi_scene...
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread Authors. # 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 # not...
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # class LexerActionType(object): CHANNEL = 0 #The type of a {@link LexerChannelAction} action. CUSTOM = 1 #Th...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
# encoding: utf-8 """ flow.py Created by Thomas Mangin on 2010-01-14. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ # Do not use __slots__ here, we never create enough of them to be worth it # And it really break complex inheritance from struct import pack from struct import unpack from exabgp.prot...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org...
from __future__ import absolute_import from typing import Any, Callable, Iterable, Tuple, Text from collections import defaultdict import datetime import six from django.db.models import Q, QuerySet from django.template import loader from django.conf import settings from zerver.lib.notifications import build_message...
#!/usr/bin/env python # -*- coding: latin-1 -*- # # Copyright 2019-2021 Blaise Frederick # # 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/LICEN...
from __future__ import unicode_literals import copy from collections import OrderedDict from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.conf import settings from django.db import models from django.db.models.fields.proxy import OrderWrt from django.db.models.fi...
import logging import os from abc import ABC from collections import defaultdict, deque from collections.abc import Mapping from typing import TYPE_CHECKING, Deque, Dict, Generator, Optional, Tuple, Type from dvc.proc.manager import ProcessManager from ..base import ( EXEC_BASELINE, EXEC_BRANCH, EXEC_HEAD...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, Ben Lopatin and contributors # 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 ...
"""Tests on the examples in the specification documents """ import re import sys import unittest from resync.resource import Resource from resync.source_description import SourceDescription from resync.capability_list import CapabilityList from resync.resource_list import ResourceList,ResourceListOrdered from resync.re...
# -*- coding: utf-8 -*- # # 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 ...
# Copyright 2018 The TensorFlow 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 # # Unless required by applica...
# PhoPlay.py # Copyright (c) <2012, 2015>, <Ben Sampson> All rights reserved. # 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 not...
"""Container classes for extraction method components. """ import sys import os from gridd import (cellfeatures, rowfeatures, estimators, classifiers, colproperties, annotations, evaluate, loaders, results, util) _v = util.verbose_print class Extractor(object): def __init_...
from datetime import datetime, timedelta import random from django.db.models import Prefetch from django.db.models.query import QuerySet from django.contrib.auth.models import User from django.db import models, transaction from django.db.models import Q, F from django.utils.functional import cached_property from natto...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'GroupTagKey' db.create_table('sentry_grouptagkey', ( ('id', self.gf('sentry.db.m...
# 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 # # Unless required by applicable law or ag...
"""Support for MQTT fans.""" import logging import voluptuous as vol from homeassistant.components import fan, mqtt from homeassistant.components.fan import ( ATTR_SPEED, SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_OSCILLATE, SUPPORT_SET_SPEED, FanEntity) from homeassistant.const import ( CONF...
''' Created on Mar 30, 2016 certain sites do not like being scraped, to get around this python needs to pretend to be a browser. You need to download the program chrome driver http://chromedriver.storage.googleapis.com/index.html I use 2.9 win32 just place chromedriver.exe into the same directory as gormonsel.exe Instr...
"""Support to manage a shopping list.""" import asyncio import logging import uuid import voluptuous as vol from homeassistant.components import http, websocket_api from homeassistant.components.http.data_validator import RequestDataValidator from homeassistant.const import HTTP_BAD_REQUEST, HTTP_NOT_FOUND from homea...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Copyright 2019 The TensorFlow 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 # # Unless required by applica...
# Copyright (C) 2014 Sereina Riniker # # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """ Torsion Fingerprints (Deviation) (TFD) According to a paper from Schulz-Gasch et a...
# # Copyright (c) 2013-2015 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# -*- coding: utf-8 -*- # # login.py # # # # # # # # # # # # # Copyright 2016 Giorgio Ladu <giorgio.ladu >at< gmail.com> # # # # ...
import agents as ag import envgui as gui import random # ______________________________________________________________________________ loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world def RandomVacuumAgent(): "Randomly choose one of the actions from the vacuum environment." p = ag.Ra...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """OAuth Server Settings Blueprint.""" from __future__ import absolute_import from...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from c7n.exceptions import PolicyValidationError from .common import BaseTest, event_data import logging import time LambdaFindingId = "us-east-2/644160558196/81cc9d38b8f8ebfd260ecc81585b4bc9/9f5932aa97900b5164502f41ae393d23" # NOQA cla...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'CharacterClassVariant.requirements' db.add_column('dnd_characterclassvariant', 'requiremen...
from __future__ import absolute_import import urwid import urwid.util import os from netlib.http import CONTENT_MISSING import netlib.utils from .. import utils from ..models import decoded from . import signals try: import pyperclip except: pyperclip = False VIEW_FLOW_REQUEST = 0 VIEW_FLOW_RESPONSE = 1 ...
""" (c) RIKEN 2017. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ import iotbx.phil from cctbx import sgtbx from dxtbx.model.experiment_list import ExperimentListFactory from dxtbx.model.experiment_list import ExperimentListDumper from dxtbx.model...
"""ACME Identifier Validation Challenges.""" import functools import hashlib import logging import socket import OpenSSL import requests from acme import errors from acme import crypto_util from acme import fields from acme import jose from acme import other logger = logging.getLogger(__name__) # pylint: disable=...
""" This module contains the machinery handling assumptions. All symbolic objects have assumption attributes that can be accessed via .is_<assumption name> attribute. Assumptions determine certain properties of symbolic objects and can have 3 possible values: True, False, None. True is returned if the object has the...
""" Client related classes (Proxy, mostly) Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ import time import logging import serpent import contextlib from . import config, core, serializers, protocol, errors, socketutil from .callcontext import current_context try: from green...
# --------------------------------------------------------------- # OVERVIEW # --------------------------------------------------------------- # The following script implements a binomial heap in Python. A binary heap is a collection of binomial trees. # A Binomial Tree of order k has following properties. # a) It has ...
# 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. import itertools import logging import math import operator import os import queue import time from threading import Thread import numpy as n...
#!python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ #...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
#!/usr/bin/env python import sys import os import guessit import locale import glob import argparse import struct import logging from extensions import valid_tagging_extensions from readSettings import ReadSettings from tvdb_mp4 import Tvdb_mp4 from tmdb_mp4 import tmdb_mp4 from mkvtomp4 import MkvtoMp4 from post_proc...
#! /usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: laran@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from datetime import date, timedelta from monthdelta import monthdelta from cal...
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2010 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function, division import nsfg import nsfg2 import first import thinkstats2 import thinkplot ...
#!/usr/bin/env python import sys from gi.repository import Gtk, Gio, Gdk, GObject from asciiplayback import * from gtkasciiplayer import * from revealerexpander import * from frameedit import * class ASCIImatorDesktop(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="ASCIImator Desktop") ...
# Copyright 2013 OpenStack Foundation. # 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 requ...
#!/usr/bin/env python2 import logging logging.basicConfig(level=logging.WARNING) from functools import partial import wx from numpy import concatenate from spacq import VERSION from spacq.gui.display.plot.static.delegator import formats, available_formats from spacq.gui.display.table.filter import FilterListDialog ...
#!/usr/bin/env python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # analytics_uvetest.py # # UVE and Alarm tests # import os import sys import threading threading._DummyThread._Thread__stop = lambda x: 42 import signal import gevent from gevent import monkey monkey.patch_all() import unitt...
#!/usr/bin/env python2 ''' This script collects PDBs corresponding to certain TCIDs (of any level) and assigns TMSs based on STRIDE and PDBTM (and a pinch of geometry) ''' from __future__ import print_function, division import xml.etree.ElementTree as ET import os, re, subprocess, sys import numpy as np import yaml im...
import numpy as np import unittest from discretize import TensorMesh, CurvilinearMesh from discretize.utils import ndgrid class BasicCurvTests(unittest.TestCase): def setUp(self): a = np.array([1, 1, 1]) b = np.array([1, 2]) c = np.array([1, 4]) def gridIt(h): return [...
#!/usr/bin/env python """ Run lldb to disassemble all the available functions for an executable image. """ from __future__ import print_function import os import re import sys from optparse import OptionParser def setupSysPath(): """ Add LLDB.framework/Resources/Python and the test dir to the sys.path. ...
#!python """ A simple high available heartbeat implementation. An instance of this is started on each host. One is elected as the worker, executing a command in a loop. The other instance of the script loops and checks by connecting to a network port if the worker is still available. Once it detects that the worker ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Copyright 2016 The Cartographer Authors # # 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 # # U...
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTRIBUTORS.txt for the list o...
"""The tests for the utility_meter component.""" from datetime import timedelta from unittest.mock import patch from homeassistant.components.utility_meter.const import ( ATTR_TARIFF, DOMAIN, SERVICE_RESET, SERVICE_SELECT_NEXT_TARIFF, SERVICE_SELECT_TARIFF, ) import homeassistant.components.utility...
#!/usr/bin/env python # Copyright 2015, Google Inc. # 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 o...
# Copyright 2022 The Magenta Authors. # # 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 ...
# -*- coding: utf-8 -*- from contextlib import contextmanager from ...query.expression import QueryExpression from ..collection import Collection from ..builder import Builder class Relation(object): _constraints = True def __init__(self, query, parent): """ :param query: A Builder instance...
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, antecedents, out_attributes, user_options, num_cores, out_path): import os from genomicode import filelib from genomicode im...
# -*- coding: utf-8 -*- """ jinja2.debug ~~~~~~~~~~~~ Implements the debug interface for Jinja. This module does some pretty ugly stuff with the Python traceback system in order to achieve tracebacks with correct line numbers, locals and contents. :copyright: (c) 2010 by the Jinja Team. :...
# coding=utf-8 # Copyright 2021 The Circuit Training Team Authors. # # 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 ap...
# Copyright 2018 The TensorFlow 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 # # Unless required by applica...
""" Covariance estimators using shrinkage. Shrinkage corresponds to regularising `cov` using a convex combination: shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile ...
# Copyright (C) 2009, Pauli Virtanen <pav@iki.fi> # Distributed under the same license as SciPy. import warnings import numpy as np from numpy.linalg import LinAlgError from scipy.linalg import get_blas_funcs from .utils import make_system from ._gcrotmk import _fgmres __all__ = ['lgmres'] def lgmres(A, b, x0=None...
#!/usr/bin/python #import urllib.request, urllib.parse, urllib.error #Use this for Python > 3 import urllib #Use this line instead of the previous for Python < 3.0 import xml.etree.ElementTree as elementree import re import string class QBConn: def __init__(self,url,appid,token=None, user_token=None,realm=""): ...
import datetime from mock import Mock, MagicMock from elasticmagic import Index from elasticmagic import ( Index, Document, DynamicDocument, SearchQuery, Params, Term, Bool, MultiMatch, FunctionScore, Sort, QueryRescorer, agg ) from elasticmagic.compiler import QueryCompiled20 from elasticmagic.util import...
from torch.utils.data import Dataset import os import collections from gyro import ( LoadGyroData, LoadOISData, LoadFrameData, GetGyroAtTimeStamp, get_static, GetMetadata, GetProjections, train_GetGyroAtTimeStamp, QuaternionProduct, QuaternionReciprocal, FindOISAtTimeS...
# Copyright 2015 The TensorFlow 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 # # Unless required by applica...
"""The tests for the Recorder component.""" # pylint: disable=protected-access from datetime import datetime, timedelta import unittest import pytest from homeassistant.components.recorder import ( CONFIG_SCHEMA, DOMAIN, Recorder, run_information, run_information_from_instance, run_information...