gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by Yuwen Xiong # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Cont...
import asyncio, discord, re, random from operator import itemgetter from discord.ext import commands from Cogs import Utils, DisplayName, Message, PickList def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(BotAdmin(bot, settings)) class BotAdmin(commands.Cog): # Init wit...
#!/usr/bin/env python2 # RDPy # # Copyright (C) 2013 Jeffrey Stiles (@uth_cr33p)(jeff@aerissecure.com) # # Todo: # - switch to asn1tinydecoder.py: http://getreu.net/public/downloads/software/ASN1_decoder/README.html # # Thank you to: # http://labs.portcullis.co.uk/application/rdp-sec-check/ # http://troels.arvin.dk/c...
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
# pylint: disable=too-many-lines """ Component to interface with cameras. For more details about this component, please refer to the documentation at https://home-assistant.io/components/camera/ """ import asyncio import logging from aiohttp import web from homeassistant.helpers.entity import Entity from homeassista...
# -*- coding: utf-8 -*- import datetime import logging import dateutil.parser import dateutil.tz from auth import Auth from elasticsearch import RequestsHttpConnection from elasticsearch.client import Elasticsearch logging.basicConfig() elastalert_logger = logging.getLogger('elastalert') def new_get_event_ts(ts_fie...
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2013 Ivo Tzvetkov # # 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 ri...
# # 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 # ...
from collections import OrderedDict from .models import Identifier from .signals import import_complete, new_metadata from . import registry, wizard_task, InputNeeded from django.db import transaction from django.contrib.contenttypes.models import ContentType from rest_framework import serializers from natural_keys i...
from django.utils import timezone from django.shortcuts import render, render_to_response from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect, HttpResponse from django.contrib import messages from .forms import ReportForm, AttachmentForm import re from django.db.models...
# Copyright 2014 Google Inc. All Rights Reserved. """Convenience functions for dealing with instances and instance templates.""" from googlecloudapis.compute.v1 import compute_v1_messages from googlecloudsdk.calliope import arg_parsers from googlecloudsdk.calliope import exceptions from googlecloudsdk.compute.lib impo...
# # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import gevent sys.path.append("../common/tests") from testtools.matchers import Equals, Contains, Not from test_utils import * import test_common import test_case from vnc_api.vnc_api import * try: import to_bgp except ImportError: ...
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # stdlib impor...
#!/usr/bin/python3 # Halide tutorial lesson 8 # This lesson demonstrates how schedule multi-stage pipelines. # This lesson can be built by invoking the command: # make tutorial_lesson_08_scheduling_2 # in a shell with the current directory at the top of the halide source tree. # Otherwise, see the platform-specifi...
from __future__ import print_function import argparse import itertools import os import random import re import shlex import string import sys import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline import pkg_resources import pluggy import py import tom...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC ''' This script allows to load a numb...
import json import logging import os from threading import RLock from uuid import uuid4 from azure.common.client_factory import get_client_from_cli_profile from msrestazure.azure_active_directory import MSIAuthentication from azure.mgmt.compute import ComputeManagementClient from azure.mgmt.network import NetworkManag...
# Copyright (C) 2014 MediaMath, Inc. <http://www.mediamath.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright 2013 IBM Corp. # Copyright 2013 Red Hat, 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 r...
# -*- coding: UTF-8 -*- # Copyright 2016-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) ''' Causes one or several :xfile:`help_texts.py` files to be generated after each complete build of the doctree. See :doc:`/dev/help_texts` for a topic overview. Usage ===== In your :xfile:`conf.py` file, add ...
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
# Copyright (c) 2017 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. from collections import defaultdict import warnings import logging from .json import json from ..common import six if six.PY2: from collections import Mapping else: ...
import urllib, ssl from socket import timeout #################################################################################################### PREFIX = "/video/letmestream" NAME = "LetMeStream" ICON = 'icon_default.png' ###########################################################################################...
r"""Routines to create data from external modellers, for comparison purposes. - DIPOLE1D: You must have Dipole1D installed and it must be in your system path; https://software.seg.org/2012/0003. - EMmod: You must have Dipole1D installed and it must be in your system path; https://software.seg.org/2015/0001. - Gr...
# Contributors: # Christopher P. Barnes <senrabc@gmail.com> # Andrei Sura: github.com/indera # Mohan Das Katragadda <mohan.das142@gmail.com> # Philip Chase <philipbchase@gmail.com> # Ruchi Vivek Desai <ruchivdesai@gmail.com> # Taeber Rapczak <taeber@ufl.edu> # Nicholas Rejack <nrejack@ufl.edu> # Josh Hanna <josh@hanna....
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Test client vfs.""" import functools import os from grr.client import vfs from grr.client.client_actions import searching from grr.lib import flags from grr.lib import test_lib from grr.lib import utils from grr.lib.rdfvalues import client as rdf_clie...
from io import BytesIO from azure.common import AzureHttpError from azure.storage.blob import ( Blob, BlockBlobService, PageBlobService, AppendBlobService, CustomerProvidedEncryptionKey, BlobBlock, BlobPermissions, ContentSettings) from tests.testcase import ( StorageTestCase, r...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division import itertools import os from collections import OrderedDict, defaultdict, deque from pex.common import pluralize from pex.compatibilit...
"""Module for testing string variables.""" class TestStringVar(BaseTestCase): def setUp(self): BaseTestCase.setUp(self) self.rawData = [] self.dataByKey = {} for i in range(1, 11): stringCol = "String %d" % i fixedCharCol = ("Fixed Char %d" % i).ljust(40) ...
"""The following methods may be used to calculate the crosscorrelation and autocorrelation for a time series. These methods are 'special' in the sense that they are able to deal with irregular time steps often observed in hydrological time series. """ from numpy import (append, arange, array, average, corrcoef, diff,...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # Copyright 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 copy of t...
#!/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. import os from urlparse import urlparse import pyauto_functional # Must be imported before pyauto import pyauto import test_utils...
import json import urllib2 from directories import userCachePath, getDataDir import os import time import base64 # @UnusedImport from pymclevel.mclevelbase import PlayerNotFound import urllib from PIL import Image from urllib2 import HTTPError import atexit import threading import traceback import logging logger = lo...
import pytest import os from flex.exceptions import ValidationError from flex.loading.schema.paths.path_item.operation.parameters import ( parameters_validator, ) from flex.validation.parameter import ( validate_parameters, ) from flex.constants import ( PATH, STRING, NUMBER, BOOLEAN, FLEX_...
#!/usr/bin/python3 import unittest from pymamba import Database, Table, _debug, xIndexMissing, xWriteFail, xTableMissing, size_mb, size_gb from subprocess import call class UnitTests(unittest.TestCase): _db_name = 'databases/unit-db' _tb_name = 'demo1' _debug = True _data = [ {'name': 'Garet...
# =============================================================================== # 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 -*- """The SleuthKit (TSK) file system implementation.""" import pytsk3 from dfvfs.lib import definitions from dfvfs.lib import errors from dfvfs.lib import tsk_image from dfvfs.path import tsk_path_spec from dfvfs.resolver import resolver from dfvfs.vfs import file_system from dfvfs.vfs import ts...
#!/usr/bin/env python # encoding: utf-8 r""" Data Module Contains the general class definition and the subclasses of the Clawpack data objects. :Authors: Kyle T. Mandli and Randall J. LeVeque (2008-08-07) Initial version Randall J. LeVeque (2008-08-07) Plotting data objects Alan McIntyre (2009-01-01) Sp...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from argparse import...
"""This module contains all Cupy specific kernel_tuner functions""" from __future__ import print_function import logging import time import numpy as np from kernel_tuner.observers import BenchmarkObserver #embedded in try block to be able to generate documentation #and run tests without cupy installed try: impo...
import logging from connexion import NoContent from flask import request from geoalchemy2 import WKTElement import osmapi import traceback import api.models from sqlalchemy import func import datetime from sqlalchemy import tuple_ from sqlalchemy.exc import SQLAlchemyError logging.basicConfig(level=logging.INFO) logg...
from gameplay.game import Game class Checkers(Game): player_mapping = { 1: 'r', 2: 'w', } def __init__(self, board=None, current_player=1): self.board = board or self.initial_board() self.current_player = current_player self.moves_without_capture = 0 @sta...
# django imports from django.conf import settings from django.contrib.auth.decorators import permission_required from django.core.urlresolvers import reverse from django.forms import ModelForm from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext...
''' Copyright (c) 2016, Battelle Memorial Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions a...
# -*- coding: utf-8 -*- """ Evaluation functions """ import logging import numpy as np from sklearn.cluster import AgglomerativeClustering, KMeans from .datasets.similarity import fetch_MEN, fetch_WS353, fetch_SimLex999, fetch_MTurk, fetch_RG65, fetch_RW, fetch_TR9856 from .datasets.categorization import fetch_AP, fet...
from distutils.command.config import config import numpy import copy from PyQt5 import QtCore from PyQt5 import QtGui from PyQt5 import QtWidgets from bumps import options from bumps import fitters import sas.qtgui.Utilities.LocalConfig as LocalConfig import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary import...
#!/usr/bin/env python # Copyright 2017 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Global system tests for V8 test runners and fuzzers. This hooks up the framework under tools/testrunner testing high-level scena...
import os import pytest import pandas as pd import pandas.util.testing as tm import ibis import ibis.expr.datatypes as dt pytest.importorskip('google.cloud.bigquery') pytestmark = pytest.mark.bigquery from ibis.bigquery.api import udf # noqa: E402 PROJECT_ID = os.environ.get('GOOGLE_BIGQUERY_PROJECT_ID', 'ibis-...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import print_function, division, absolute_import import numpy as np from matplotlib.text import Text from .frame import RectangularFrame def sort_using(X, Y): return [x for (y, x) in sorted(zip(Y, X))] class TickLabels(Text): ...
from urllib import quote from datetime import datetime from django.test import Client from questionnaire.forms.sections import SectionForm, SubSectionForm from questionnaire.models import Questionnaire, Section, SubSection, Question, QuestionGroup, QuestionOption, \ MultiChoiceAnswer, NumericalAnswer, QuestionGro...
# Copyright 2017 Dravetech AB. All rights reserved. # # The contents of this file are 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...
#!/usr/bin/env python # Copyright (c) 2014 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 os import ntpath import posixpath import sys import collections import unittest SCRIPT_DIR = os.path.dirname(os.path.abspat...
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
#!/usr/bin/env python # Copyright 2020 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. """Tests for mb_validate.py.""" from __future__ import print_function from __future__ import absolute_import import sys import ast imp...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
# 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...
import socket from os import mkdir from os.path import join, exists from sys import platform from asyncio import sleep from math import sqrt from uuid import uuid4 from enum import Enum from csv import DictReader from cyrandom import choice, shuffle, uniform from time import time from pickle import dump as pickle_dump...
# 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...
import warnings import numpy as np from numpy.testing import assert_array_almost_equal as assert_close from numpy.testing import (assert_array_equal, assert_raises, assert_almost_equal) import skimage from skimage import data from skimage import exposure from skimage.exposure.exposure impor...
#!/usr/bin/env python # encoding: utf-8 """ The IPython engine application Authors: * Brian Granger * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full licen...
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Sylvain Afchain <sylvain.afchain@enovance.com> # # 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.apach...
import sys import random import signal #Timer handler, helper function class TimedOutExc(Exception): pass def handler(signum, frame): #print 'Signal handler called with signal', signum raise TimedOutExc() class Manual_player: def __init__(self): pass def move(self, temp_board, temp_block, old_m...
""" 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 use this ...
""" @author: Fyzel@users.noreply.github.com @copyright: 2017 Englesh.org. All rights reserved. @license: https://github.com/Fyzel/weather-data-flaskapi/blob/master/LICENSE @contact: Fyzel@users.noreply.github.com @deffield updated: 2017-06-14 """ from flask_restplus import fields from api.restplus im...
# encoding: utf-8 """ Axis-related chart objects. """ from __future__ import absolute_import, print_function, unicode_literals from ..enum.chart import XL_TICK_LABEL_POSITION, XL_TICK_MARK from ..oxml.ns import qn from ..text.text import Font from ..util import lazyproperty class _BaseAxis(object): """ Bas...
# Copyright 2012 Nebula, 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 agree...
import unittest import os from textwrap import dedent import numpy as np from bltest import attr from baiji import s3 from bltest import skip_if_unavailable, skip_on_import_error from bltest.extra_asserts import ExtraAssertionsMixin from unittest import mock from lace.mesh import Mesh from lace.serialization import obj...
#!/usr/bin/env python ''' 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")...
import math import numpy as np from keras.layers import Input, LSTM, Dense from keras.models import Model from keras import backend as K from keras.callbacks import EarlyStopping from keras import losses from keras.optimizers import Adam import tensorflow as tf class RNN(): def __init__(self, z_dim, action_dim,...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apac...
""" Test the challenger by sending requests to it via a TiddlyWeb instance. The LDAP interface is mocked as setting up a real one in a test environment is too much effort. """ import httplib2 import ldap from mock import Mock from test.fixtures import initialize_app def setup_module(): initialize_app() def t...
#!/usr/bin/env python3 PKG = 'lg_earth' NAME = 'test_kmlsync' KMLSYNC_HOST = '127.0.0.1' KMLSYNC_PORT = 8765 KML_ENDPOINT = 'http://' + KMLSYNC_HOST + ':' + str(KMLSYNC_PORT) WINDOW_SLUG = 'center' import sys import re import time import json import rospy import rostest import unittest import requests import xml.etr...
from __future__ import absolute_import, print_function import itertools from collections import defaultdict from datetime import timedelta import six from django.conf import settings from django.db.models import Min, Q from django.utils import timezone from sentry import tagstore, tsdb from sentry.app import env fro...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the mask module. """ import astropy.units as u import numpy as np from numpy.testing import assert_allclose, assert_almost_equal import pytest from ..bounding_box import BoundingBox from ..circle import CircularAperture, CircularAnnulus fro...
# engine/url.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 """Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates information...
import itertools as itt import numpy as np import pytest import mbuild as mb from mbuild.coordinate_transform import ( AxisTransform, ChangeOfBasis, CoordinateTransform, RigidTransform, Rotation, RotationAroundX, RotationAroundY, RotationAroundZ, Translation, _spin, angle, ...
import numpy as np import cv2 import time import os import psutil import gc from grid_game import GridGame from util.mem_convert import bytes2human class Environment: """docstring for Environment""" BUFFER_LEN = 1 EPISODE_STEPS = 18000 EPOCH_COUNT = 10 EPOCH_STEPS = 10000 EVAL_EPS = 0.001 FRAMES_SKIP = 1 FRAM...
import random import json import datetime import signal ENFORCED_TIME = 5 hrst_table = json.load(open('yay.json')) class EnforcedTimeExecption(Exception): pass def EnforcedTimeHandler(signum, frame): raise EnforcedTimeExecption() class Player(object): ''' Player Class Container. ''' ...
# Copyright 2010 United States Government as represented by the # 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/LICE...
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import threading import os import sys import traceback try: from multiprocessing import current_process from multiprocessing import util as mputil except ImportError: current_process = mputil = None # noqa from . import curren...
import fnmatch import glob import os import re import sys from itertools import dropwhile from optparse import make_option from subprocess import PIPE, Popen import django from django.core.management.base import CommandError, NoArgsCommand from django.utils.text import get_text_list from django.utils.jslex import prep...
#!/usr/bin/env python """ Read protein match output produced by alignment-panel-civ.py and group it by pathogen (either virus or bacteria). This is currently only useful when you are matching against a subject protein database whose titles have a pathogen accession number in the 5th |-separated field, like this: civ...
import warnings import pytest import numpy as np from numpy.lib.nanfunctions import _nan_mask, _replace_nan from numpy.testing import ( assert_, assert_equal, assert_almost_equal, assert_no_warnings, assert_raises, assert_array_equal, suppress_warnings ) # Test data _ndat = np.array([[0.6244, np.nan, 0.2...
from copy import copy from datetime import datetime, timedelta import json from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.module_loading import import_by_path from enum import Enum from jsonfield import JSONField...
# Copyright (c) 2015 Mirantis, 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...
#! /usr/bin/env python """ Python API for KB SRU """ import sys import urllib import requests from lxml import etree SRU_BASEURL = 'http://jsru.kb.nl/sru/sru' SRU_BASEURL += '?version=1.2&maximumRecords=%i' SRU_BASEURL += '&operation=searchRetrieve' SRU_BASEURL += '&startRecord=%i' SRU_BASEURL += '&recordSchema=%s' S...
import calendar import datetime import re import sys import urllib import urlparse from email.utils import formatdate from django.utils.datastructures import MultiValueDict from django.utils.encoding import smart_str, force_unicode from django.utils.functional import allow_lazy ETAG_MATCH = re.compile(r'(?:W/)?"((?:\...
# 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 may ...
import mock import functools from modularodm import Q from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from api_tests import utils as test_utils from framework.auth.core import Auth from osf_tests.factories import PreprintFactory, AuthUserFactory, ProjectFactory, SubjectFactory,...
# -*- coding: utf-8 -*- ''' This module allows you to manage extended attributes on files or directories .. code-block:: bash salt '*' xattr.list /path/to/file ''' from __future__ import absolute_import # Import Python Libs import logging # Import salt libs import salt.utils.mac_utils from salt.exceptions impor...
import asyncio from collections import deque, namedtuple import itertools import logging import os import threading import weakref import warnings from tornado.concurrent import Future from tornado.ioloop import IOLoop from ..protocol import nested_deserialize from ..utils import get_ip from .registry import Backend...
# -*- coding: utf-8 -*- # # Copyright 2015-present MongoDB, 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 applicab...
# ----------------------------------------------------------------------------- import datetime import os import glob from PySide import QtCore, QtGui from dpa.config import Config from dpa.action.registry import ActionRegistry from dpa.notify import Notification, emails_from_unames from dpa.ptask.area import PTask...
# -*- coding: utf-8 -*- """ core ~~~~ Core functionality shared between the extension and the decorator. :copyright: (c) 2022 by Ashley Sommer (based on flask-cors by Cory Dolphin). :license: MIT, see LICENSE for more details. """ import re import logging import collections from datetime import tim...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from functools import partial from unittest.mock import MagicMock import pytest from indico.core import ...
import os from unittest import TestCase from unittest.mock import Mock import pandora.clientbuilder as cb from pandora.client import APIClient from pandora.transport import DEFAULT_API_HOST class TestTranslatingDict(TestCase): class TestDict(cb.TranslatingDict): KEY_TRANSLATIONS = {"FOO": "BAR"} ...
# Copyright (C) 2007-2012 Michael Foord & the mock team # E-mail: fuzzyman AT voidspace DOT org DOT uk # http://www.voidspace.org.uk/python/mock/ from warnings import catch_warnings import unittest2 as unittest from mock.tests.support import is_instance from mock import MagicMock, Mock, patch, sentinel, mock_open, c...
# helper.py # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php from __future__ import print_function import os import sys from unittest import TestCase import time i...
########################################################################## # # Copyright (c) 2013-2014, Image Engine Design 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: # # * Redi...
import difflib _file_template = """ <div id="diff_table_div"> %(summary)s %(table)s </div> """ _table_template = """ <table class="diff" id="difflib_chg_%(prefix)s_top" cellspacing="0" cellpadding="0" rules="groups"> <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup> <col...