gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import absolute_import
import functools
from datetime import datetime, timedelta
import mock
import pytest
import pytz
from django.core import mail
from sentry.app import tsdb
from sentry.models import Project, UserOption
from sentry.tasks.reports import (
DISABLED_ORGANIZATIONS_USER_OPTION_KEY, ... | |
# Copyright 2015 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/licenses/LICENSE-2.0
#
# Unless required by a... | |
#!/usr/bin/env python
#
# Copyright (c) 2013 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import distutils.dir_util
import optparse
import os
import shutil
import sys
LIBRARY_PROJECT_NAME = 'xwalk_core_library'
XWALK_CORE... | |
"""Losonczy Lab data archive utilities.
These utilities can be used to archive and restore files to a remote host.
Initially designed to work with Amazon Web Services S3.
Working with the AWS S3 bucket requires two packages:
>>> pip install --user boto3 awscli
To get started, you need to setup an account with AWS I... | |
# Copyright 2014 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 req... | |
import os
from multiprocessing import Process, cpu_count, Queue
from multiprocessing.queues import Empty
from time import sleep
from warnings import warn
from .CubeTextureClass import CubeTexture
from ..events_processing.eventClasses import Event, EventTypes
from .TextureManagerServer import serve, TexturesManagerSer... | |
# Copyright 2015 Jake Ross
#
# 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, softwa... | |
# -*- 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 field 'Participant.order'
db.add_column(u'public_project_participant', 'order',
... | |
"""Compute Linearly constrained minimum variance (LCMV) beamformer."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Roman Goj <roman.goj@gmail.com>
# Britta Westner <britta.wstnr@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from ..rank import compute_rank
from ..io.meas... | |
# -*- coding: utf-8 -*-
from datetime import timedelta
from cms import constants
from cms.utils.conf import get_cms_setting
from django.core.exceptions import PermissionDenied
from cms.exceptions import NoHomeFound, PublicIsUnmodifiable
from cms.models.managers import PageManager, PagePermissionsPermissionManager
from... | |
"""Common IO api utilities"""
import bz2
from collections import abc
import dataclasses
import gzip
from io import BufferedIOBase, BytesIO, RawIOBase, StringIO, TextIOWrapper
import mmap
import os
from typing import IO, Any, AnyStr, Dict, List, Mapping, Optional, Tuple, Union, cast
from urllib.parse import (
urljo... | |
"""The basic dict based notebook format.
The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access
(ipython_genutils.ipstruct.Struct). The functions in this module are merely
helpers to build the structs in the right form.
"""
# Copyright (c) IPython Developm... | |
# 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 under th... | |
# Bojan Nikolic <b.nikolic@mrao.cam.ac.uk>
"""Simulate data observed by an interferometer
USEFUL NOTES
---------------------------------------------------------------------------------
From http://casa.nrao.edu/Memos/CoordConvention.pdf :
UVW is a right-handed coordinate system, with W pointing towards the
source, ... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017-2022 F4PGA 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
#
# Unl... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
# Copyright 2016 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) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | |
# Copyright (c) 2013 VMware, 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 b... | |
"""Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import StringIO
import errno
import os
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, SkipTest, skipUnl... | |
# Copyright 2013 Mirantis 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 ... | |
"""TcEx testing profile Class."""
# standard library
import json
import logging
import os
import re
import sys
from collections import OrderedDict
from random import randint
# third-party
import colorama as c
from ..app_config_object import InstallJson, LayoutJson, Permutations
from ..env_store import EnvStore
from .... | |
import requests
import datetime
import json
class XboxApi(object):
def __init__(self, api_key=None, language=None, base_url=""):
self.api_key = api_key
if not self.api_key:
import os
self.api_key = os.environ.get("XBOXAPIKEY", None)
if not self.api_key:
... | |
import hashlib
import json
import os
from random import randrange
import falcon
import mock
from mock import patch
from deuce import conf
from deuce.tests import ControllerTest
from deuce.util.misc import relative_uri
class TestVaults(ControllerTest):
def setUp(self):
super(TestVaults, self).setUp()
... | |
# Copyright 2013 Rackspace Development Company, L.P.
# 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 agr... | |
import imp
import logging
import os
import sys
from mock import Mock, patch
from gparray import GpDB, GpArray
from gppylib.operations.startSegments import StartSegmentsResult
from gppylib.test.unit.gp_unittest import GpTestCase, run_tests
class GpStart(GpTestCase):
def setUp(self):
# because gpstart doe... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | |
"""FHIaims calculator interface."""
# FHIaims.py - IO routines for phonopy-FHI-aims
# methods compatible with the corresponding ones from ase.io.aims
# only minimal subset of functionality required within phonopy context is implemented
#
# Copyright (C) 2009-2011 Joerg Meyer (jm)
# All rights reserved.
#
# This file is... | |
import datetime
from dateutil.relativedelta import relativedelta
from django import forms
from django.db.models import Q
from selectable import forms as selectable
from timepiece import utils
from timepiece.crm.models import Project, ProjectRelationship
from timepiece.entries.models import Entry, Location, ProjectHo... | |
# Copyright (c) 2014 The Beardcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
from decimal imp... | |
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_array_almost_equal, run_module_suite
from scipy.stats import (binned_statistic, binned_statistic_2d,
binned_statistic_dd)
from scipy.lib.six import u
class TestBinnedStatisti... | |
# Copyright 2011 OpenStack Foundation.
# 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 w... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.template import Template, Context
from django.utils.html import str... | |
# Generated by Haxe 3.3.0
import math as python_lib_Math
import math as Math
import requests as Requests
import functools as python_lib_Functools
import inspect as python_lib_Inspect
import json as python_lib_Json
import random as python_lib_Random
class _hx_AnonObject:
def __init__(self, fields):
self._... | |
#!/usr/bin/env python2.7
# Copyright 2016 Autodesk 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 la... | |
"""Implementation of code management magic functions.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with th... | |
"""The tests for the MQTT sensor platform."""
from datetime import datetime, timedelta
import json
from unittest.mock import ANY, patch
from homeassistant.components import mqtt
from homeassistant.components.mqtt.discovery import async_start
import homeassistant.components.sensor as sensor
from homeassistant.const imp... | |
#
# 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
# ... | |
# This module is part of Hypatia and is released under the
# MIT License: http://opensource.org/licenses/MIT
"""Why stuff is drawn; logic flow for the game.
Game logic, game component interaction.
Glues various modules/game components together with behaviors defined
in methods belonging to Game().
Note:
I have no... | |
"""
PureMVC Python Demo - wxPython Employee Admin
By Toby de Havilland <toby.de.havilland@puremvc.org>
Copyright(c) 2007-08 Toby de Havilland, Some rights reserved.
"""
import puremvc.interfaces
import puremvc.patterns.mediator
import model, enum, main, wx, vo
class DialogMediator(puremvc.patterns.mediator.Mediator... | |
from __future__ import division, print_function, absolute_import
import signal
from functools import wraps
from .util import range, class_from_instancemethod
def _set_metainfo(method, key, value):
key = '_benchmarking_%s' % key
setattr(method, key, value)
def _get_metainfo(method, key):
key = '_benchm... | |
# Copyright 2015 Huawei Technologies Co.,LTD.
#
# 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... | |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Applies an issue from Rietveld.
"""
import getpass
import json
import logging
import optparse
import os
import subprocess
import... | |
# NOTE - Still seems to be a leak here somewhere
# gateway count doesnt hit zero. Hence the print statements!
import sys; sys.coinit_flags=0 # Must be free-threaded!
import win32api, pythoncom, time
import pywintypes
import os
import winerror
import win32com
import win32com.client.connect
from win32com.test.util impo... | |
# Copyright 2013 Mario Graff Guerrero
# 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 wri... | |
from securityhandlerhelper import securityhandlerhelper
dateTimeFormat = '%Y-%m-%d %H:%M'
import arcrest
from arcrest.agol import FeatureLayer
from arcrest.agol import FeatureService
from arcrest.hostedservice import AdminFeatureService
import datetime, time
import json
import os
import common
import gc
import arcpy... | |
# postgresql/on_conflict.py
# Copyright (C) 2005-2016 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
from ...sql.elements import ClauseElement, _literal_as_binds
from ...sql.d... | |
"""XJPATH simplifies access to the python data structures using relatively
simple path syntax. It doesn't not only lookup value, it also can
validate found data type as well as create value if a target structure is a
dictionary.
The typical scenarios are:
- you need to lookup an element from nested dicts.
- you nee... | |
# Copyright 2012 Michael Still and Canonical 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
#
# ... | |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | |
"""Builds Swagger data model definitions using PAPI source docs."""
from __future__ import print_function
import argparse
import json
import modulefinder
import os
import re
import sys
def find_matching_obj_def(obj_defs, new_obj_def):
"""Find matching object definition."""
for obj_name in obj_defs:
e... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Tong Zhang <zhangt@frib.msu.edu>
# 2016-10-16 20:20:57 PM EDT
#
from flame import Machine
import numpy as np
import matplotlib.pyplot as plt
lat_fid = open('test.lat', 'r')
m = Machine(lat_fid)
## all BPMs and Correctors (both horizontal and vertical)
bpm_ids, cor_ids =... | |
"""Test structuring of collections and primitives."""
from typing import Any, Dict, FrozenSet, List, MutableSet, Optional, Set, Tuple, Union
import attr
from hypothesis import assume, given
from hypothesis.strategies import (
binary,
booleans,
data,
floats,
frozensets,
integers,
just,
l... | |
# 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... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
from catapult_base import dependency_manager
from catapult_base import cloud_storage
from catapult_base.dependency_manager impo... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Cloudwatt
# 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/l... | |
# Copyright 2016 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... | |
## @file
# This file contain unit test for CommentParsing
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
"""
Module for managing Windows systems and getting Windows system information.
Support for reboot, shutdown, join domain, rename
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
"""
import ctypes
import logging
import platform
import time
from datetime import datetime
import salt.ut... | |
import json
import os
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
from django.db.models import Q
import mock
from pyquery import PyQuery as pq
from olympia import amo
from olympia.activity.models import ActivityLog
from olympia.addons.forms import AddonFormBa... | |
# Copyright 2014, 2015 OpenMarket Ltd
#
# 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 ... | |
from google.protobuf import text_format
from .caffe import get_caffe_resolver
from .errors import KaffeError, print_stderr
from .layers import LayerAdapter, LayerType, NodeKind, NodeDispatch
from .shapes import make_tensor
class Node(object):
def __init__(self, name, kind, layer=None):
self.name = name
... | |
from __future__ import print_function, division, absolute_import
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
import unittest
# unittest.mock is not available in 2.7 (though unittest2 might contain it?)
try:
... | |
# Copyright (c) 2020 krrr
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, su... | |
"""The flunearyou component."""
import asyncio
from datetime import timedelta
from pyflunearyou import Client
from pyflunearyou.errors import FluNearYouError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant... | |
# Copyright (c) 2013 OpenStack Foundation
#
# 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 ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2013 Kitware 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 cop... | |
# 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... | |
from PyQt4 import QtCore, QtGui
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
import networkx as nx
import random
import sys
im... | |
# Copyright (C) 2014 Taylor Turpen
#
# 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.
# This program is distributed in th... | |
from importlib import import_module
import os
import sys
from django.apps import apps
from django.db.migrations.recorder import MigrationRecorder
from django.db.migrations.graph import MigrationGraph
from django.utils import six
from django.conf import settings
MIGRATIONS_MODULE_NAME = 'migrations'
class Migration... | |
"""
Form classes
"""
from __future__ import absolute_import, unicode_literals
import copy
import warnings
from django.core.exceptions import ValidationError
from django.forms.fields import Field, FileField
from django.forms.util import flatatt, ErrorDict, ErrorList
from django.forms.widgets import Media, media_prope... | |
# ftypes.py - Functional dictionary and list types for Python 2.1+
#
# Author: Dave Benjamin <ramen@ramenfest.com>
# Version: 1.1.2
"""
Introduction
------------
The purpose of this module is to provide a dictionary and list type that can
aid in relational algebra, functional programming, list-oriented programming,
... | |
# Copyright 2013-present Barefoot 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 ... | |
from sqlite3 import connect
from hashlib import sha1
from os import urandom
from random import randrange
import datetime
import calendar
from calendar import monthrange
f = "data/roomres.db"
'''
---------------------------------------
Find list of values functions
----------------------------------------
'''
def c... | |
# Copyright 2014 Yajie Miao Carnegie Mellon University
# 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
#
# THIS CODE IS PROVIDED *AS IS* B... | |
# Copyright (c) 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... | |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
from datetime import datetime
import logging
import os
import shutil
import subprocess
import sys
# Generates the sky_... | |
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utilities for standard operations on URIs of different kinds."""
from __future__ import print_function
import re
import sys
import urllib
import ... | |
#!/usr/bin/env python2
# Tokenizer code adapted by David Humphrey from Neal Norwitz's C++ tokenizer:
#
# Copyright 2007 Neal Norwitz
# Portions 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 obt... | |
from functools import wraps
from ..utils.isaac import is_live_site
from ..utils.log import log, TEST, INFO, ERROR
from collections import OrderedDict
__all__ = ['TestWithDependency']
class TestWithDependency(object):
"""Declares a Regression Test item with dependencies and tracks results.
Use as a decora... | |
# Copyright 2021 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
#!/usr/bin/env python
# Copyright (c) 2016 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 ... | |
from __future__ import print_function
import distutils
import logging
import os
import subprocess
import sys
import warnings
import numpy
from theano import config
from theano.compat import decode, decode_iter
from theano.configdefaults import local_bitwidth
from theano.gof.utils import hash_from_file
from theano.gof... | |
from sympy.core.basic import Basic, S, C, sympify
from sympy.core import oo, Rational, Pow
from sympy.core.cache import cacheit
class Order(Basic):
"""
Represents O(f(x)) at the point x = 0.
Definition
==========
g(x) = O(f(x)) as x->0 if and only if
|g(x)|<=M|f(x)| near x=0 ... | |
"""
Functions for executing ES searches
"""
import json
import logging
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.db import transaction
from django.db.models import Q as Query
from elasticsearch.exceptions import NotF... | |
# -*- coding: utf-8 -*-
""" Sahana Eden Assets Model
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software withou... | |
#!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~ Copyright (C) 2002-2004 TechGame Networks, LLC.
##~
##~ This library is free software; you can redistribute it and/or
##~ modify it under the terms of the BSD style License as found in the
##~ LICENSE file included with this distribution.... | |
"""
downgrade_11.py from ioc_writer
Created: 12/17/15
Purpose: Provide a single reference class for converting an OpenIOC 1.1 document to OpenIOC 1.0.
This downgrade process is lossy as there are conditions, parameters and link metadata which may be present in the 1.1 indicator that cannot be expressed in the 1.0 in... | |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module contains some utility functions and classes that are used in the chemenv package.
"""
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materials Project"
__credits__ = "Geof... | |
# -*- coding: utf-8 -*-
import six
import unittest
from os import path
from webob.multidict import MultiDict
from iktomi.utils.storage import VersionedStorage
from iktomi.templates import Template, BoundTemplate
from iktomi.templates import jinja2 as jnj
from iktomi.templates.jinja2 import TemplateEngine
import jinja2
... | |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for creating instance templates."""
import collections
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import constants
from googlecloudsdk.compute.lib import image_utils
from... | |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... | |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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/li... | |
# -*- coding: utf-8 -*-
"""
Module: build_particle_array.py
Created on Sat Oct 19 15:34:52 2013
@author: gav
Description:
"""
### Imports
from __future__ import print_function
import os, sys
import time
import os.path as osp
import numpy as np
import numpy.ma as ma
import pickle
from numpy import array, newaxis
imp... | |
#!/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 Base_Applet import Base_Applet
import Tkinter as Tk
from widgets import *
# ICP Widgets
from . import *
class v_BDPC(Base_Applet):
"""
Base BDPC View. Collects and displays the following information:
Parameters:
* Closed-Loop MMC Parameters (P/V/I)
* Phase Shift from SYNC
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.