gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from pyecs import *
from pyecs.application import main,profile,onHotswap
from pyecs.components import *
import pyecs
import pyecs.application
from collections import defaultdict
from testing import *
from funcy import partial
import mock
class TestApplication():
@... | |
"""Test TrueType font subsetting & embedding code.
This test uses a sample font (Vera.ttf) taken from Bitstream which is called Vera
Serif Regular and is covered under the license in ../fonts/bitstream-vera-license.txt.
"""
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation, ... | |
# Copyright (c) 2016-present, Facebook, 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... | |
import json
import re
from django.utils.translation import ugettext as _
from ide.models.files import ResourceFile, ResourceIdentifier
__author__ = 'katharine'
def generate_wscript_file_sdk2(project, for_export=False):
jshint = project.app_jshint
wscript = """
#
# This file is the default set of rules to com... | |
#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# 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. Redis... | |
# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import pytest
import numpy as np
from mock import MagicMock
from ..data import ComponentID, Component, Data
from ..subset import Subset
from .. import parse
class TestParse(object):
def test_... | |
from __future__ import absolute_import, unicode_literals
import logging
from mopidy import models
from mopidy.audio import PlaybackState
from mopidy.compat import urllib
from mopidy.internal import deprecation, validation
from mopidy.core import triggers as triggers
from mopidy.core import listener
logger = logging... | |
from flask import render_template, current_app, request, \
flash, redirect, url_for, jsonify
from flask_security import roles_accepted, current_user, \
utils as security_utils
import uuid
from . import admin
from .forms import UserForm
from .forms import data_required, match_pass
from pgscm import sqla, user_... | |
#
# Copyright 2017 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 or agreed to in writing... | |
#! /usr/bin/python
import os
import sys
import subprocess
import json
import argparse
import io
import time
from flask import Flask, json, Response, render_template, make_response, request
RestIP="127.0.0.1"
RestPort=8182
DBName="Cassandra-Netmap"
app = Flask(__name__)
## File Fetch ##
@app.route('/ui/img/<filena... | |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | |
from typing import Callable, Tuple, Optional, List, Dict, Any, TYPE_CHECKING
from ray.rllib.env.external_env import ExternalEnv
from ray.rllib.env.external_multi_agent_env import ExternalMultiAgentEnv
from ray.rllib.env.multi_agent_env import MultiAgentEnv
from ray.rllib.env.vector_env import VectorEnv
from ray.rllib.... | |
# Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | |
#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | |
from __future__ import division, print_function, absolute_import
import numpy as np
import amitgroup as ag
# If skimage is available, the image returned will be wrapped
# in the Image class. This is nice since it will be automatically
# displayed in an IPython notebook.
try:
from skimage.io import Image
except Imp... | |
import os
from django import forms
from django.conf import settings
import commonware.log
from tower import ugettext as _, ugettext_lazy as _lazy
import amo
from amo.utils import slugify, slug_validator
from happyforms import Form, ModelForm
from translations.widgets import TranslationTextInput, TranslationTextarea
... | |
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
import sys
import json
import pandas as pd
import re
import glob as glob
import os
from collections import defaultdict
from xml.etree import cElementTree as ET
import metatlas.metatlas_objects as metob
from metatlas.helpers... | |
from django import forms
from django.forms.formsets import BaseFormSet
from ietf.doc.models import *
from ietf.name.models import IntendedStdLevelName
from ietf.group.models import Group
from ietf.secr.utils.ams_utils import get_base, get_revision
from ietf.secr.groups.forms import RoleForm, get_person
import dateti... | |
# Copyright 2014 The Swarming Authors. All rights reserved.
# Use of this source code is governed by the Apache v2.0 license that can be
# found in the LICENSE file.
"""Json serializable properties."""
from google.appengine.ext import ndb
from google.appengine.api import datastore_errors
from components import utils... | |
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# these are system modules
import numpy
import sys
# these are my local ones
from env import gidgetConfigVars
import tsvIO
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
NA_VALUE = -999999
# -#-#-#-#-... | |
import copy
import plistlib
import uuid
from datetime import datetime
from django.http import HttpResponse
from django.test import TestCase
from django.utils.crypto import get_random_string
from zentral.contrib.inventory.models import EnrollmentSecret, MetaBusinessUnit
from zentral.contrib.mdm.models import (Artifact, ... | |
""" Part of weight_app
:copyright: (c) 2012 by Andreas Madsack.
:license: BSD, see LICENSE for more details.
"""
from flask import Blueprint, Response, request, abort, redirect, flash, \
url_for, render_template
from jinja2 import TemplateNotFound
from flask.ext.login import login_required, login_user, log... | |
import calendar
from datetime import datetime, timedelta
import json
import pytz
import requests
import time
import urllib
from ditto import TITLE, VERSION
from .models import Account, Album, Artist, Scrobble, Track
from .utils import slugify_name
from ..core.utils import datetime_now
LASTFM_API_ENDPOINT = "http://w... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Database Module
# --------------------
from __future__ import unicode_literals
import MySQLdb
from MySQLdb.times import DateTimeDeltaType
from markdown2 import UnicodeWithAttrs
import warnings
import datetime
import ... | |
from unittest import TestCase
from ..config import Config
from ..state import JsonState, MongodbState
from pymongo import MongoClient
import os
from random import choice
USER1 = '29:1SPw4GoUNGtDmuYex45S13g-1zgri1qp43uA345yjSFc'
USER2 = '29:1SPw4GoUNGtDmuYex45S13g-1zgri1qp43uA547yjSFc'
CHANNEL1 = 'skype'
CHANNEL2 = 'te... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... | |
"""
CIECAM02 Colour Appearance Model
================================
Defines the *CIECAM02* colour appearance model objects:
- :class:`colour.appearance.InductionFactors_CIECAM02`
- :attr:`colour.VIEWING_CONDITIONS_CIECAM02`
- :class:`colour.CAM_Specification_CIECAM02`
- :func:`colour.XYZ_to_CIECAM02`
- :f... | |
import ly
from ly import document
from ly import rhythm
from ly import pitch
from ly import lex
import math
import numpy
import re
#TODO: FIX CHORD/RHYTHM PARSER, IMPLEMENT HEADER AND CHORD PROCESSING
#==GLOBAL VARIBALES============================================================
BAR_LENGTH = 1.0 #This needs to chan... | |
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also distributed with certain s... | |
# -*- coding: UTF-8 -*-
"""
literature
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""
__version__ = '4.0'
content = {
'book_headline': [
'<#book_pseudoscience_author#>','<#book_pseudoscience_title#>','<#book_pseudoscientific#>',
'<#book_title_front#>',
],
... | |
"""Amazon SQS Transport.
Amazon SQS transport module for Kombu. This package implements an AMQP-like
interface on top of Amazons SQS service, with the goal of being optimized for
high performance and reliability.
The default settings for this module are focused now on high performance in
task queue situations where ... | |
"""
Comsystem command module.
Comm commands are OOC commands and intended to be made available to
the Player at all times (they go into the PlayerCmdSet). So we
make sure to homogenize self.caller to always be the player object
for easy handling.
"""
from django.conf import settings
from evennia.comms.models import C... | |
# ===============================================================================
# Copyright 2011 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/licens... | |
# -*- coding: utf-8 -*-
#
# SelfTest/Cipher/AES.py: Self-test for the AES cipher
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to th... | |
# 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 applicable law or ... | |
#
# 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... | |
import unittest
from functools import wraps
import jsonstreamer
json_file_name = lambda test_fn: 'tests/json_files/' + test_fn.__name__[5:] + '.json'
def load_test_data(func):
"""loads some json from a file with the same name as the test"""
@wraps(func)
def wrapper(self, *args, **kwargs):
with ... | |
# Copyright 2014 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 or agreed to in writing, ... | |
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtUiTools import QUiLoader
from datetime import datetime
import logging
import math
import os
import re
import string
import subprocess
import sys
import unicodedata
import tempfile
import stat
LOG = logging.getLogger('storyTime.utils')
def isFrozen... | |
#!/usr/bin/python
import os
import sys
import asyncio
import tty
import termios
import fcntl
import re
import curses
class Caps:
def Caps(self):
self.has_vt102 = False
self.type = None
#write = sys.stdout.write
#
#def color_test():
# text="xYz"; # Some test text
#
# write("\n ... | |
#!/usr/bin/env python
import math
import rospy
from geometry_msgs.msg import Twist
from tf2_msgs.msg import TFMessage
from std_msgs.msg import Empty # for land/takeoff/emergency
from std_msgs.msg import Int8
from ardrone_autonomy.msg import Navdata # for receiving navdata feedback
from keyboard_controller impo... | |
"""
Contains basic data structures used throughout the rest of Q2MM.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import copy
import logging
import numpy as np
import os
import re
import sys
import constants as co
import filetypes
logger = logging.g... | |
#===============================================================================
# Copyright 2007 Matt Chaput
#
# 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... | |
# -*- coding: utf-8 -*-
import django
from django.db import connection
from django.db.models import Count
from django.db.models.query_utils import Q
from django.utils import translation
from hvad.test_utils.data import NORMAL, STANDARD
from hvad.test_utils.testcase import HvadTestCase, minimumDjangoVersion
from hvad.te... | |
# Copyright 2019 The KerasTuner 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 ... | |
import unittest
from conans.test.tools import TestServer, TestClient
from conans.model.ref import ConanFileReference
import os
from conans.paths import CONANFILE
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.util.files import load
class OnlySourceTest(unittest.TestCase):
def setU... | |
# Copyright 2014 Cisco Systems, 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 requir... | |
"""
HTTP Exception
--------------
This module processes Python exceptions that relate to HTTP exceptions
by defining a set of exceptions, all subclasses of HTTPException.
Each exception, in addition to being a Python exception that can be
raised and caught, is also a WSGI application and ``webob.Response``
object.
Thi... | |
from psphere import ManagedObject, cached_property
class ExtensibleManagedObject(ManagedObject):
_valid_attrs = set(['availableField', 'value'])
def __init__(self, mo_ref, client):
ManagedObject.__init__(self, mo_ref, client)
self._valid_attrs = set.union(self._valid_attrs, ManagedObject._valid... | |
from django import forms
from django.conf import settings
from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \
PasswordResetForm
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.core.validators import validate_email
from django.db.m... | |
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from pprint i... | |
"""Use the EPA crosswalk to connect EPA units to EIA generators and other data.
A major use case for this dataset is to identify subplants within plant_ids,
which are the smallest coherent units for aggregation.
Despite the name, plant_id refers to a legal entity that often contains
multiple distinct power plants, eve... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2019, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigip_message_routing_r... | |
"""Stock market information from Alpha Vantage."""
from datetime import timedelta
import logging
import voluptuous as vol
from alpha_vantage.timeseries import TimeSeries
from alpha_vantage.foreignexchange import ForeignExchange
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const impor... | |
import six.moves.builtins as builtins
from theano.tensor.signal.pool import *
import keras.backend as K
import theano.tensor as T
def m_maxpool2d(x, pool_size, strides=(1, 1), border_mode='valid',
dim_ordering='th'):
if border_mode == 'same':
w_pad = pool_size[0] - 2 if pool_size[0] % 2 == ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'status': ['preview'],
'supp... | |
# Copyright 2017 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... | |
"""
desitarget.too
==============
Targets of Opportunity.
.. _`moving average`: https://stackoverflow.com/a/14314054
.. _`rolling sum`: https://stackoverflow.com/a/28288535
"""
import os
import numpy as np
from astropy.table import Table
from desiutil.log import get_logger
from desitarget import io
from desitarget.... | |
# -*- coding: utf-8 -*-
import unittest
import logging
import numpy as np
from .. import alignElastix
from .. import alignSift
from ..alignFFT import alignFFT
from ..alignSimple import alignMin
from ..alignSimple import alignMax
from ..alignSimple import alignCentroid
from ..alignSimple import alignGaussMax
from ..ty... | |
#!/usr/bin/env python
# Copyright 2008 Orbitz WorldWide
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
import peewee
from datetime import datetime
from bakthat.conf import config, load_config, DATABASE
import hashlib
import json
import sqlite3
import os
import requests
import logging
log = logging.getLogger(__name__)
database = peewee.SqliteDatabase(DATABASE)
class JsonField(peewee.CharField):
"""Custom JSON fie... | |
import json
import mimetypes
import re
import sys
import time
from collections import OrderedDict
from http.cookiejar import parse_ns_headers
from pprint import pformat
from typing import Any, List, Optional, Tuple
import requests.auth
RE_COOKIE_SPLIT = re.compile(r', (?=[^ ;]+=)')
Item = Tuple[str, Any]
Items = List... | |
#!/usr/bin/env python
#The MIT License (MIT)
#Copyright (c) 2016 Massimiliano Patacchiola
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ... | |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompa... | |
# 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 ... | |
# Modifications copyright (C) 2017, Baidu.com, Inc.
# Copyright 2017 The Apache Software Foundation
# 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 A... | |
from django.core.exceptions import ValidationError
from rest_framework import exceptions
from rest_framework import serializers as ser
from rest_framework.fields import empty
from rest_framework.exceptions import ValidationError as DRFValidationError
from api.base.exceptions import Conflict, JSONAPIException
from api.... | |
#!/usr/bin/env python
# Copyright (C) 2015 OpenStack, LLC.
#
# 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... | |
# Copyright 2019 Verizon Media
#
# 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 a... | |
from keras import backend as K
from keras import activations
from overrides import overrides
from .word_alignment import WordAlignmentEntailment
from ...tensors.backend import switch, apply_feed_forward
class DecomposableAttentionEntailment(WordAlignmentEntailment):
"""
This layer is a reimplementation of th... | |
from datetime import datetime, date
import tempfile
from netCDF4 import Dataset
import os
import numpy as np
from cdo import Cdo
import datetime
#from math import *
from ocgis.util.shp_process import ShpProcess
#from ocgis.util.shp_cabinet import ShpCabinetIterator
import ocgis
from flyingpigeon import config
from p... | |
from __future__ import unicode_literals
import mock
import os
import sys
from tempfile import NamedTemporaryFile
import pytest
import six
from dallinger.config import Configuration
from dallinger.config import get_config, LOCAL_CONFIG
class TestConfigurationUnitTests(object):
def test_register_new_variable(sel... | |
"""Base class for sparse matrix formats using compressed storage."""
from __future__ import division, print_function, absolute_import
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy.lib.six import xrange, zip as izip
from .base import spmatrix, isspmatrix, SparseEfficiencyWarnin... | |
# 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
# d... | |
# Copyright 2014 Scalyr 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 writing, so... | |
"""
Support for Xiaomi Yeelight Wifi color bulb.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.yeelight/
"""
import logging
import voluptuous as vol
from homeassistant.util.color import (
color_temperature_mired_to_kelvin as mired_to_kelvin,... | |
#!/usr/bin/env python
import os
import platform
import stat
import time
import unittest
import mock
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import client_fixture
from grr.lib import flags
from grr.lib import flow_runner
from grr.lib import test_lib
from grr.li... | |
import io
import logging
import time
from urllib.parse import parse_qs, urlparse
import requests
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.utils.functional import cached_property
from waldur_core.core import models as core_models
from waldur_core.core import... | |
# 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... | |
# -*- 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):
# Changing field 'ProjectCountByMinute.time_spent_total'
db.alter_column(
u'sentry_projectcountb... | |
from datetime import date
from django import forms
from django.core.exceptions import FieldError, ValidationError
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms.models import (modelform_factory, ModelChoiceField,
fields_for_model, construct_instance, ModelFormMetaclass)
from django... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import base64
import logging
from keyring.errors import (PasswordDeleteError)
from keyring.backend import KeyringBackend
from botocore.exceptions import EndpointConnectionError
import boto3facade.s3
import string
import six
import ke... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Nahuel Riva
# 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 c... | |
#
# 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 us... | |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | |
"""Armis Integration for Cortex XSOAR - Unit Tests file
This file contains the Pytest Tests for the Armis Integration
"""
import json
import pytest
import time
import CommonServerPython
def test_untag_device_success(requests_mock):
from Armis import Client, untag_device_command
mock_token = {
'data'... | |
"""(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017"""
from datetime import datetime
from parser.box import Box
from parser.navigation_page import NavigationPage
from settings import JAHIA_DATE_FORMAT
from parser.sidebar import Sidebar
import logging
import re
from utils impor... | |
# Copyright 2011 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 python
#
# Copyright 2016 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 require... | |
import os
import json
import sys
import pdb
from pprint import pprint
def azure_login(agent):
try:
agent.shell("az account show")
print("Azure CLI login verified")
except Exception as e:
print("It appears that you are not logged into the azure cli...")
print("Please login to th... | |
from __future__ import absolute_import
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import timezone
from .models import Book, BookSigning
class ArchiveIndexViewTests(TestCase):
fixtures... | |
import queue
def part1():
class Computer:
def __init__(self):
self.registers = {}
self.last_played = None
self.index = 0
def print(self):
print(self.index, self.registers)
def getIndex(self):
return self.index
def value(... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import shutil
import tempfile
import warnings
import numpy
import tables
from tables.exceptions import FlavorWarning
from tables.tests import common
from tables.tests.common import allequal
from tables.tests.common import unittest, test_filename... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker, rc
def _lorentz(freq, inten, x, fwhm):
y = np.zeros(len(x))
for fdx, idx in zip(freq, inte... | |
# coding=utf-8
#
# Copyright 2014 Red Hat, Inc.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# ... | |
# ===============================================================================
# Copyright 2011 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... | |
from __future__ import unicode_literals
import copy
import logging
from django.utils import six
from django.utils.encoding import force_unicode
from django.utils.six.moves.urllib.parse import quote as urllib_quote
from django.utils.translation import ugettext_lazy as _
from djblets.registries.errors import Registrati... | |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Sales: test suites
"""
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User as DjangoUser
from ... | |
#!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
"""Test the cron_view interface."""
from grr.gui import runtests_test
from grr.lib import cron
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
class TestCronView(test... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.