text
stringlengths
475
200k
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that missing 'sources' files are treated as fatal errors when the the generator flag 'msvs_error_on_missing_sources' is set. ""...
# 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...
import itertools import os import posixpath import sys import unittest import warnings from posixpath import realpath, abspath, dirname, basename from test import support, test_genericpath try: import posix except ImportError: posix = None # An absolute path to a temporary filename for testing. We can't rely ...
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" interface TestArrayBuffer { attribute ArrayBuffer bufferAttr; void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, ArrayBuffer[] arg3, sequence<ArrayBuffer> arg4); attribute ArrayBufferView viewAttr; ...
from functools import wraps from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.shortcuts import resolve_url from django.utils import six from django.utils.decorators import available_attrs from django.utils.six.moves.urll...
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, [EMAIL], All rights reserved. # LLNL-CODE-647188 # # F...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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...
# # Copyright 2015 Peter Sprygada <[EMAIL]> # # This file is part of Ansible # # Ansible 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...
#!/usr/bin/env python3 # This file is part of OpenSoccerManager-Editor. # # OpenSoccerManager 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 la...
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import json from datetime import timedelta import lo...
# # Copyright © 2012 - 2021 Michal Čihař <[EMAIL]> # # This file is part of Weblate <https://weblate.org/> # # 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 #...
"""K-means clustering""" # Authors: Gael Varoquaux <[EMAIL]> # Thomas Rueckstiess <[EMAIL]> # James Bergstra <[EMAIL]> # Jan Schlueter <[EMAIL]> # Nelle Varoquaux # Peter Prettenhofer <[EMAIL]> # Olivier Grisel <[EMAIL]> # Mathieu Blondel <[EMAIL]> # ...
# Copyright (C) 2010 Chris Jerdonek ([EMAIL]) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the followin...
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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. T...
# 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) import pytest from ...
# module pyparsing.py # # Copyright (c) 2003-2015 Paul T. McGuire # # 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, cop...
""" Example intercepting uncaught exceptions using Sanic's error handler framework. This may be useful for developers wishing to use Sentry, Airbrake, etc. or a custom system to log and monitor unexpected errors in production. First we create our own class inheriting from Handler in sanic.exceptions, and pass in an i...
# -*- coding: utf-8 import re from HTMLParser import HTMLParser from difflib import unified_diff class FortuneHTMLParser(HTMLParser): body = [] valid = '''<!doctype html><html> <head><title>Fortunes</title></head> <body><table> <tr><th>id</th><th>message</th></tr> <tr><td>11</td><td>&lt;script&gt;alert(&quot;This...
# -*- coding: utf-8 -*- ############################################################################### # # ExportIncrementalTickets # Returns a lightweight representation of what changed in the ticket "since you last asked". # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apac...
import os import sys import numpy as np import math def findBinIndexFor(aFloatValue, binsList): #print "findBinIndexFor: %s" % aFloatValue returnIndex = -1 for i in range(len(binsList)): thisBin = binsList[i] if (aFloatValue >= thisBin[0]) and (aFloatValue < thisBin[1]): returnIndex = i break return ...
# Copyright (c) 2012 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...
import unittest from conans.test.tools import TestClient from conans.paths import CONANFILE from conans.util.files import load import os class OrderLibsTest(unittest.TestCase): def setUp(self): self.client = TestClient() def _export(self, name, deps=None, export=True): def _libs(): ...
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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. # # Ansible is d...
"""Models / Schema of pgur.in""" from google.appengine.ext import ndb class Accounts(ndb.Model): """Stores registration information.""" playstore_url = ndb.StringProperty() appstore_url = ndb.StringProperty() winstore_url = ndb.StringProperty() default_url = ndb.StringProperty() title = ndb....
from __future__ import unicode_literals import collections from importlib import import_module import os import pkgutil import sys import django from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import (BaseCommand, C...
from __future__ import nested_scopes """ ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
#!/usr/bin/env python """ Utilities related to parsing files """ from collections import OrderedDict import sys PY3 = sys.version_info[0] == 3 __all__ = [ 'FixedLengthError', 'FixedLengthUnknownRecordTypeError', 'FixedLengthSeparatorError', 'FixedLengthJustificationError', 'FixedLengthFieldParser...
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 = {'metadata_version': '1.1', 'status': ['preview'], ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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 2 of the # License, or (at your option) any...
import unittest from Util import Util class TestUtil(unittest.TestCase): def testConvertTupleListToMap(self): tupleList=[] tupleList.append((0,0)) tupleList.append((0,1)) tupleList.append((1,0)) tupleList.append((1,2)) tupleList.append((2,2)) wiringMap=Util.c...
#!/usr/bin/python # This file is part of Ansible # # Ansible 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. # # Ansible is distributed...
from a10sdk.common.A10BaseClass import A10BaseClass class EntryCfg(A10BaseClass): """This class does not support CRUD Operations please use parent. :param distance: {"minimum": 1, "type": "number", "maximum": 255, "format": "number"} :param protocol: {"enum": ["any", "static", "dynamic"], "type": "s...
# # 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...
from datetime import datetime from rest_framework import generics, viewsets from rest_framework.exceptions import ParseError from rest_framework.response import Response from .models import Project, Task, TaskType from .serializers import ProjectSerializer, TaskSerializer, TaskTypeSerializer class TaskViewSet(views...
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/]+$', help_text = _("Example: '/a...
""" NOTE: Anytime a `key` is passed into a function here, we assume it's a raw byte string. It should *not* be a string representation of a hex value. In other words, passing the `str` value of `"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"` is bad. You want to pass in the result of calling .decode...
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL #.#.# # EnterpriseDB #.# # PostgreSQL #.# beta# # PostgreSQL #.#beta# VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_...
""" Provides full versioning CRUD and representation for collections of xblocks (e.g., courses, modules, etc). Representation: * course_index: a dictionary: ** '_id': a unique id which cannot change, ** 'org': the org's id. Only used for searching not identity, ** 'course': the course's catalog number ...
#!/edx/app/edxapp/venvs/edxapp/bin/python # pylint: skip-file from __future__ import print_function from argparse import ArgumentParser from datetime import datetime, timedelta import gzip import os import re import sys import django from django.utils import timezone from six.moves.configparser import ConfigParser ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# 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 ...
#!/usr/bin/env python # 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...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/env python # Copyright 2015-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Res...
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
# -*- coding: utf-8 -*- # # 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 #...
"""Support code for CI environments.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import abc import base64 import json import os import tempfile from .. import types as t from ..encoding import ( to_bytes, to_text, ) from ..io import ( read_text_file, w...
# -*- coding: utf-8 -*- from bda.plone.payment.interfaces import IPayment from bda.plone.payment.interfaces import IPaymentEvent from bda.plone.payment.interfaces import IPaymentFailedEvent from bda.plone.payment.interfaces import IPaymentSettings from bda.plone.payment.interfaces import IPaymentSuccessEvent from zope....
# # 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...
import textwrap SEPARATOR = "-" * 70 indent = lambda s: textwrap.fill(textwrap.dedent(s)) class CondaBuildException(Exception): pass class YamlParsingError(CondaBuildException): pass class UnableToParse(YamlParsingError): def __init__(self, original, *args, **kwargs): super(UnableToParse, sel...
""" This is an updated socket module for use on JVMs > 1.5; it is derived from the old jython socket module. It is documented, along with known issues and workarounds, on the jython wiki. http://wiki.python.org/jython/NewSocketModule """ _defaulttimeout = None import errno import jarray import string import struct im...
from __future__ import unicode_literals from django import forms from django.conf import settings from guardian.compat import url, patterns from django.contrib import admin from django.contrib import messages from django.contrib.admin.widgets import FilteredSelectMultiple from django.core.urlresolvers import reverse f...
# 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...
''' Created on 2017/1/13 :author: hubo ''' from configlist import list_config from listmodules import list_modules, list_proxy import jinja2 import os import os.path import shutil from pkgutil import walk_packages from vlcp.event import Event def _merge_all(func): def _func(): result = func('vlcp') ...
# 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 ...
# 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...
from Screens.Wizard import Wizard from Components.Label import Label from Components.Language import language from os import system class WizardLanguage(Wizard): def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True): Wizard.__init__(self, session, showSteps, showSt...
# # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 # # Written by Hye-Shik Chang <[EMAIL]> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jisx0213') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multiby...
""" homeassistant.components.switch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component to interface with various switches that can be controlled remotely. """ from datetime import timedelta import logging import os from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityC...
import pytest from _helper import consume, tick, count_tasks notimplemented = xfail = pytest.mark.xfail beforeEach = pytest.mark.usefixtures import datetime from waterf import queue, task, snake messages = [] @pytest.fixture def clear_messages(): while messages: messages.pop() def P(message='P'): ...
# Adapted from test_file.py by Daniel Stutzbach from __future__ import unicode_literals import sys import os import errno import unittest from array import array from weakref import proxy from functools import wraps from UserList import UserList from test.test_support import TESTFN, check_warnings, run_unittest, mak...
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2016 Nick Hall # # 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 2 of the License, or # (at your option) a...
''' Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. The MIT 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 without restriction, including without limitati...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
from ctypes import * import maya.cmds as cmds import Calibration as C import unittest class SixAxis(object): def __init__(self, device, channels, name, load = True): """ Maps a single six-axis sensor to a Maya transform Device: An instance of PAIO.AIODevice() Channels: The channel indicies for the sensor in th...
""" .. _ref_geometric_example: Geometric Objects ~~~~~~~~~~~~~~~~~ The "Hello, world!" of VTK """ import pyvista as pv ############################################################################### # This runs through several of the available geomoetric objects available in # VTK which PyVista provides simple conve...
""" """ import logging import os import sys from datetime import timedelta try: # pragma: nocover from ConfigParser import ConfigParser config = ConfigParser() except ImportError: # pragma: nocover from configparser import ConfigParser config = ConfigParser(strict=False) from wheezy.caching.logging...
#---------------------------------------------------------------------- # Copyright (c) 2011-2015 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, including ...
from django.utils.cache import ( cc_delim_re, get_conditional_response, set_response_etag, ) from django.utils.deprecation import MiddlewareMixin from django.utils.http import parse_http_date_safe class ConditionalGetMiddleware(MiddlewareMixin): """ Handle conditional GET operations. If the response has a...
# Copyright (c) 2012-2014, Michael DeHaan <[EMAIL]> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os # used...
######################################################################## # $HeadURL$ # File : WatchdogFactory.py # Author : Stuart Paterson ######################################################################## """ The Watchdog Factory instantiates a given Watchdog based on a quick determination of the local...
from base_studio_test import ContainerBase from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.utils import verify_ordering class BadComponentTest(ContainerBase): """ Tests that components with bad content do not break the Unit page. """ __test__ = False def get_bad_html_content...
import pygame, StringIO, sys, socket, os from gmusicapi import Webclient, exceptions class UrlGetter: def __init__(self, sck_path, user, passwd): pygame.init() pygame.mixer.init() self.sck_path = sck_path self.webapi = Webclient() self.socket = socket.socket(socket.AF...
#!/usr/bin/python try: import serial except: print('You do not have pySerial installed, which is needed to control the serial port.') print('Information on pySerial is at:\nhttp://pyserial.wiki.sourceforge.net/pySerial') import reprap, time, sys #reprap.snap.printOutgoingPackets = True #reprap.snap.printIncomingPa...
"""Test OpenBabel executables from Python Note: Python bindings not used On Windows or Linux, you can run these tests at the commandline in the build folder with: "C:\Program Files\CMake 2.6\bin\ctest.exe" -C CTestTestfile.cmake -R pytest -VV You could also "chdir" into bui...
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Converted from the original South migration 0002_default_rate_limit_config.py from django.db import migrations, models from django.conf import settings from django.core.files import File def forwards(apps, schema_editor): """Add default modes""" ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # models/fmt.py """ Helper functions for formatting pretty representations of PyPhi models. """ from itertools import chain from .. import config, utils # TODO: will these print correctly on all terminals? SMALL_PHI = "\u03C6" BIG_PHI = "\u03D5" # repr verbosity leve...
import numpy as np from statsmodels.graphics.dotplots import dot_plot import pandas as pd from numpy.testing import dec # If true, the output is written to a multi-page pdf file. pdf_output = False try: import matplotlib.pyplot as plt import matplotlib have_matplotlib = True except ImportError: have_m...
''' Location example for Jeeves with confidentiality policies. ''' from abc import ABCMeta, abstractmethod from macropy.case_classes import macros, enum import JeevesLib from sourcetrans.macro_module import macros, jeeves class InternalError(Exception): def __init__(self, message): self.message = message # De...
from __future__ import unicode_literals import datetime from dateutil.relativedelta import relativedelta import pytz from tracpro.test import factories from tracpro.test.cases import TracProTest from ..charts import chart_baseline from ..forms import BaselineTermFilterForm from ..models import BaselineTerm class...
#sudo apt-get install pypy pypy-setuptools #git clone https://github.com/eleme/thriftpy.git #cd thriftpy #make sudo pypy setup.py install #from thriftpy.protocol.binary import TBinaryProtocolFactory #from thriftpy.transport.buffered import TBufferedTransportFactory #from thriftpy.transport.framed import TFramedTranspo...
# # Copyright © 2012 - 2021 Michal Čihař <[EMAIL]> # # This file is part of Weblate <https://weblate.org/> # # 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 #...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
# -*- coding: utf-8 -*- import threading import weakref import re # from django.template.defaultfilters import slugify from django.core import serializers from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.core.paginator import Paginator from django.http import ...
# Copyright 2012, Jeroen Hoekx <[EMAIL]> # # This file is part of Ansible # # Ansible 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. #...
from datetime import datetime from functools import lru_cache import cv2 import math import os import sqlite3 import re import time import numpy as np import quaternion from visnav.algo import tools from visnav.algo.image import ImageProc from visnav.algo.model import SystemModel from visnav.missions...
# Copyright 2011 Matt Chaput. 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...
import numpy as np import torch import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.ops import DeformConv2d from mmdet.core import (build_assigner, build_sampler, images_to_levels, multi_apply, multiclass_nms, unmap) from mmdet.core.anchor.point_generator import MlvlPointGenerator f...
from __future__ import unicode_literals import logging import sys import types import warnings from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed from django.db import connections, transaction from django.urls import get_resolver...
import json import unittest from django.contrib.postgres import forms from django.contrib.postgres.fields import HStoreField from django.contrib.postgres.validators import KeysValidator from django.core import exceptions, serializers from django.db import connection from django.test import TestCase from .models impor...
""" Run the CEA scripts and unit tests as part of our CI efforts (cf. The Jenkins) """ import os import shutil import tempfile import cea.config import cea.inputlocator import cea.workflows.workflow __author__ = "Daren Thomas" __copyright__ = "Copyright 2020, Architecture and Building Systems - ETH Zurich" __cred...
""" Implement different Image blend Mode. Author: Chienli Ma Date: 2015.01.08 Incentive: It's hard to find a image blending tool in python. Some rare tool either have little mode or out_of_dated and hard to install. Therefore I just implement all methods available on in Internet. Recommended usage: ...
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import unittest import pyxb import sample from pyxb.namespace.builtin import XMLSchema_instance as xsi class TestTrac0202 (unittest.TestCase): def tearDown (self): pyxb.utils.domut...
from __future__ import unicode_literals from django.conf.urls import include, url from django.test import TestCase from django.utils import six from rest_framework import generics, routers, serializers, status, viewsets from rest_framework.renderers import ( BaseRenderer, BrowsableAPIRenderer, JSONRenderer ) from...
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils import timezone from django.db import models, migrations def fill_tables(apps, schema_editor): eventsforbusv2 = apps.get_model('AndroidRequests', 'EventForBusv2') eventsforbusstop = apps.get_model('AndroidRequests', 'EventForBus...
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
"Base Cache class." import warnings from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(DjangoRuntimeWarning): pass # Memcached does not accept keys longer than this. MEMCACHE_MAX_KEY_LENGTH = 250 cl...