gt
stringclasses
1 value
context
stringlengths
2.49k
119k
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause import numpy as np import pytest from scipy import interpolate, sparse from copy import deepcopy import joblib from sklearn.base import is_classifier from sklearn.datasets import lo...
# # 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 2014 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 a...
""" SoftLayer.load_balancer ~~~~~~~~~~~~~~~~~~~~~~~ Load Balancer Manager/helpers :license: MIT, see LICENSE for more details. """ from SoftLayer import utils class LoadBalancerManager(utils.IdentifierMixin, object): """Manages SoftLayer load balancers. See product information here: http://w...
import unittest import ctypes from struct import calcsize from pyardrone.utils.structure import Structure class SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): a = ctypes.c_int class Y(X): b = ctypes.c_int class Z(X): ...
# coding=utf-8 # Copyright 2022 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import functools import json as _json from unittest import mock from urllib.parse import urlparse, parse_qs import yarl class AiohttpClientMocker: """Mock Aiohttp client requests.""" def __init__(self): """Initialize the r...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# Copyright (c) 2012 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Tests for git_drover.""" import os import shutil import subprocess import sys import tempfile import unittest sys.path.insert(0, os...
# Copyright 2015 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 a...
# stdlib from typing import List from typing import Optional from typing import Type from typing import Union # third party from nacl.encoding import HexEncoder from nacl.signing import SigningKey from nacl.signing import VerifyKey from pydantic import EmailStr from typing_extensions import final # relative from .......
#!/usr/bin/python # Unit tests for PostgreSQL on Linux (Fedora) # This is a stripped down copy of the SQL Server tests. import sys, os, re import unittest from decimal import Decimal from testutils import * _TESTSTR = '0123456789-abcdefghijklmnopqrstuvwxyz-' def _generate_test_string(length): """ Returns a ...
from __future__ import unicode_literals import pytest from tests.helpers import verify_table_html from tests.models import Foo from tri_table import Column, Table, Struct, order_by_on_list def test_sort_list(): class TestTable(Table): foo = Column() bar = Column.number(sort_key='bar') data...
# 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...
from __future__ import unicode_literals import datetime import re import sys from unittest import skipIf import warnings from xml.dom.minidom import parseString try: import pytz except ImportError: pytz = None from django.core import serializers from django.core.urlresolvers import reverse from django.db.mod...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 or...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
"""Skype client user interface control. """ __docformat__ = 'restructuredtext en' import weakref from .enums import * from .errors import SkypeError from .utils import * class Client(object): """Represents a Skype client. Access using `skype.Skype.Client`. """ def __init__(self, Skype): """__i...
#!/usr/bin/env python # Copyright JS Foundation and other contributors, http://js.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....
# 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 ...
import unittest import axelrod class TestResultSet(unittest.TestCase): @classmethod def setUpClass(cls): cls.players = ('Alternator', 'TitForTat', 'Random') cls.test_outcome = { 'payoff': [ [[11.0, 13, 15], [13, 15.0, 14], [10, 14, 8.0]], [[11.0, 13...
# parameter.py """Contains parameter types for use in `enterprise` ``Signal`` classes.""" import functools import inspect import numpy as np import scipy.stats from enterprise.signals.selections import selection_func def sample(parlist): """Sample a list of Parameters consistently (i.e., keeping track of h...
import py from rpython.translator.translator import TranslationContext, graphof from rpython.translator.backendopt.all import backend_optimizations from rpython.translator.simplify import (get_graph, transform_dead_op_vars) from rpython.flowspace.model import Block, Constant, summary from rpython.conftest import option...
# Copyright 2015 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 a...
# -*- coding: UTF-8 -*- import math import os import random import pygame from constants import BLACK, GAME_WIDTH, TACTICS, WEAPON_POWER, START_WITH_SHIZ_MULTIPLIER from helpers import hyphenate, load_image from text import MenuGrid, TextBox WIDTH = GAME_WIDTH/2 HEIGHT = 24 TEXT_AREA_CHAR_LEN = 8 TEXT_AREA_WIDTH = ...
# Copyright 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. """VTGateCursor, and StreamVTGateCursor.""" import itertools import operator import re from vtdb import base_cursor from vtdb import dbexceptions write_sql_pattern...
from __future__ import unicode_literals from django.contrib.admin.util import flatten_fieldsets from django.db import models from django import forms from django.forms.models import modelform_factory from django.utils.cache import add_never_cache_headers from django.utils.translation import ugettext as _, string_conca...
import copy class Reverse(object): """ Reverses the direction of the particle it hits """ def __init__(self, owning_particle): super(ReverseClassName, self).__init__() self.owning_particle = owning_particle def collide(self, another_particle): for n in range(0, another_par...
# Copyright 2012 Red Hat, Inc. # Copyright 2013 IBM Corp. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
#!/usr/bin/python3 __author__ = 'Przemek Decewicz' import gzip import sys import pkg_resources from argparse import ArgumentParser, RawDescriptionHelpFormatter from Bio import SeqIO from compare_predictions_to_phages import genbank_seqio from glob import glob from os import makedirs, path from PhiSpyModules import log...
# Copyright 2009-2012 10gen, 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,...
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
"""piddletest.py This module puts the various PIDDLE backends through their paces. """ from __future__ import print_function from sping import pagesizes from sping.pid import * import string import math backends = ['PDF','PIL','TK', 'PS','SVG', 'WX' ] # 'piddleAI','piddleQD','piddleGL' ] backends.sort() #----...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import css_checker from os import path as os_path import re from sys import path as sys_path import unittest _HERE = os_path.dirname(o...
# Copyright 2013 Mirantis Inc. # Copyright 2013 Rackspace Hosting. # # 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 # # Unles...
# epydoc.py: manpage-style text output # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: man.py,v 1.6 2003/07/18 15:46:19 edloper Exp $ # """ Documentation formatter that produces man-style documentation. @note: This module is under development. It generates incomplete documentation pages, and is not yet incorpe...
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# file findingaids/fa_admin/tests/views.py # # Copyright 2012 Emory University Library # # 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...
""" CSS 3 definitions - requires CSS 1 module. """ import textwrap from codeintel2.constants_css1 import CSS_ATTR_DICT as CSS1_ATTR_DICT from codeintel2.constants_css1 import CSS_PROPERTY_ATTRIBUTE_CALLTIPS_DICT as CSS1_PROPERTY_ATTRIBUTE_CALLTIPS_DICT CSS_PSEUDO_CLASS_NAMES = """first-letter first-line link active ...
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
#! /usr/bin/python ''' Interface to Twitter streaming API - Grabs JSON data based on chosen keywords - Also relays the PIDs related to the JSON responses to ensure they match up TODO: Add watching for in-stream rate limiting / error messages - Doesn't currently honour tweet deletion messages (TODO) ''' import time im...
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Parsing and converting a recognition response # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class MyScriptResponse(object): @staticmethod def fromDict(response): instanceId = response.get('instanceId', None) result = MyScriptResult.fromDict...
import numpy as np from numpy.testing import assert_equal, assert_ import pandas import pandas.util.testing as ptesting from statsmodels.base import data as sm_data #class TestDates(object): # @classmethod # def setupClass(cls): # nrows = 10 # cls.dates_result = cls.dates_results = np.random.rando...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Validate VO Services.""" # STDLIB import multiprocessing import os import warnings from collections import OrderedDict # ASTROPY from astropy.io import votable from astropy.io.votable.exceptions import E19 from astropy.io.votable.validator import html...
# -*- coding: utf-8 -*- """ femagtools.convert ~~~~~~~~~~~~~~~~~~ Convert FEMAG files to various unstructured grid file formats """ import logging import numpy as np from femagtools import isa7 from femagtools import nc from collections import defaultdict logger = logging.getLogger('femagtools.convert') ...
# Copyright 2015 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 a...
""" These tests require a broker to be running on the local host with default credentials. Update the variables below to run in an alternate configuration. Note that these tests include shutting down the domain and all databases inside, so DO NOT run these tests against a production domain. """ import unittest impor...
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
# Created by Evgeny Kamyshanov on March, 2014 # Copyright (c) 2013-2014 BEFREE Ltd. # Modified by Evgeny Kamyshanov on March, 2015 # Copyright (c) 2014-2015 Evgeny Kamyshanov # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softw...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import base64 import binascii import copy import struct import xml.etree.ElementTree as ET from urllib.parse import urlparse from svtplay_dl.error import ServiceError from svtplay_dl.error i...
""" Optimization cards (:mod:`structmanager.genesis.cards_opt`) =========================================================== .. currentmodule:: structmanager.genesis.cards_opt` Many input cards related to the optimization problem are wrapped in this module. The input cards more related to the solver are contained in m...
import urllib import urllib2 import time import os import colorama from colorama import init, Fore, Back, Style colorama.init(autoreset=True); log_file = os.path.dirname(__file__) + "/../nutaq.log" MERGE_SUFFIX = "MERGE/Merge.tml" TAPE_SUFFIX = "TapeService/TapeService.tml" class MergeState: RUNNING = "RUNNI...
"""Tests for the EntityPlatform helper.""" import asyncio from datetime import timedelta import logging from unittest.mock import Mock, patch import pytest from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, PERCENTAGE from homeassistant.core import CoreState, callback from homeassistant.exceptions import Ho...
"""Utilities for collecting objects based on "is" comparison.""" # 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://w...
# Copyright 2015 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 a...
import dilap.core.lsystem as lsy import dilap.core.plotting as dtl import dilap.core.context as cx import dilap.geometry.tools as gtl from dilap.geometry.vec3 import vec3 from dilap.geometry.quat import quat from dilap.geometry.pointset import pointset import dilap.modeling.model as dmo import dilap.topology.trimesh as...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from builtins import str as unicode from quark_runtime import * _lazyImport.plug("slack.event") import quark.reflect import slack class SlackEvent(_QObject): """ ...
# 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 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import posixpath import mimetypes from itertools import...
from serve import db # ----------------------------------------------------------------------------- # Dataset-related models # ----------------------------------------------------------------------------- class Dataset(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Co...
#!/usr/bin/python3 # # Copyright (C) 2008, 2009, 2010 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, #...
# -*- coding: utf-8 -*- from django.apps import apps from django.db import models from django.conf import settings from django.contrib.auth.models import Group, UserManager from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured, ValidationError from django.utils.encoding im...
import sqlite3 from typing import List # from .cfg import getdbdir as _cfg_database_directory from .external import abspath, epoch2iso, getcurtime, indexer from .types import Backup, ChecksumError, File from .utils import StopException, TaskRunner, getcap def indexpath(path: str) -> None: for file_path, _inode i...
import test_support class FunctionNamingRuleTest(test_support.TestBase): def setUp(self): self.set_default_rules_selection(['FunctionNamingRule']) self.set_default_error_id('function naming') self.set_default_error_severity('style') def test_function_declaration_correct_names(self): ...
from contextlib import contextmanager import logging import os import re import shutil import subprocess import tempfile from urllib.parse import urlparse, unquote, quote import boto3 from dropbox.dropbox import Dropbox from dropbox.files import CommitInfo, UploadSessionCursor import requests logger = logging.getLogg...
from corrdb.common.models import UserModel from corrdb.common.models import ProjectModel from corrdb.common.models import EnvironmentModel from corrdb.common.models import RecordModel from corrdb.common.models import TrafficModel from corrdb.common.models import StatModel from flask.ext.stormpath import user from flask...
# -*- 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 "L...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# -*- coding: utf-8 -*- import os import stat import uuid import time import logging import tarfile import tempfile from .. import utils class SshTarballTransferMixin(object): """ Transfers resources and recipes by packing them to tar.gz and copying it via ssh. """ def _transfer(self, pack_path,...
# -*- coding: utf-8 -*- """A parser for Portable Executable format files.""" import pefile from plaso.events import time_events from plaso.lib import errors from plaso.lib import eventdata from plaso.lib import specification from plaso.parsers import interface from plaso.parsers import manager class PEFormatExceptio...
""" Tests common to genericpath, macpath, ntpath and posixpath """ import unittest from test import test_support import os import genericpath import sys def safe_rmdir(dirname): try: os.rmdir(dirname) except OSError: pass class GenericTest(unittest.TestCase): # The path module to be tes...
#!/usr/bin/env python3 import os import argparse import pickle from collections import OrderedDict import lxml.etree as ET from data_structs import ConnectionType, Loc from tile_import import make_top_level_pb_type from tile_import import make_top_level_tile # =======================================================...
# Copyright 2017 Square, 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 .plugin import SimStatePlugin class SimStateLibc(SimStatePlugin): """ This state plugin keeps track of various libc stuff: """ #__slots__ = [ 'heap_location', 'max_str_symbolic_bytes' ] LOCALE_ARRAY = [ b"\000\000", b"\000\000", b"\000\000", b"\000\000", b"\000\000", b"\000\000", # ...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Thomas Scholtes. # # 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 ...
import numpy as np import pytest import tensorflow as tf from tests.layers.flows.helper import (quadratic_transform, QuadraticFlow, npyops, invertible_flow_standard_check) from tfsnippet.layers import SplitFlow, SequentialFlow, ReshapeFlow class SplitFlowTestCase(tf.test.TestCa...
from collections import defaultdict from sympy import S, Symbol, Tuple from sympy.core.compatibility import range from sympy.ntheory import n_order, is_primitive_root, is_quad_residue, \ legendre_symbol, jacobi_symbol, totient, primerange, sqrt_mod, \ primitive_root, quadratic_residues, is_nthpow_residue, nthr...
# Copyright 2011 Nebula, 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 ...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Rackspace # # 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 # # Un...
# -*- coding: utf-8 -*- # Copyright 2014 Mark Brand - c01db33f (at) gmail.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....
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from django.db.utils import OperationalError class Migration(SchemaMigration): def forwards(self, orm): try: db.delete_foreign_k...
# Copyright (c) 2018 PaddlePaddle 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 appli...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2014 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 ...
"""Aiohttp test utils.""" import asyncio from contextlib import contextmanager import json as _json import re from unittest import mock from urllib.parse import parse_qs from aiohttp import ClientSession from aiohttp.client_exceptions import ClientError, ClientResponseError from aiohttp.streams import StreamReader fro...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
from __future__ import unicode_literals from decimal import Decimal import re from datetime import date, timedelta, datetime import logging from django.contrib.sites.models import Site from django.db.models import Max from django.utils import translation from django.utils.encoding import python_2_unicode_compatible f...
# # Benjamin C. Meyer # Modified by Scott Wolchok # # Overall rules: # Agents at plants reproduce as much as possible # Agents are born with a random direction away from the plant # Agents send a message with they attack # Agents always attack # Agents goto the location of the attack, exception scouts that keep...
""" owtf.config ~~~~~~~~~~~ The Configuration object parses all configuration files, loads them into memory, derives some settings and provides framework modules with a central repository to get info. """ import logging from collections import defaultdict try: # PY3 from urllib.parse import urlparse except Impor...
#!/usr/bin/env python # Copyright 2012 Google Inc. All Rights Reserved. """Unit test for ebq_crypto module.""" from google.apputils import app import logging from google.apputils import basetest as googletest import ebq_crypto as ecrypto _KEY1 = '0123456789abcdef' _PLAINTEXT1 = 'this is test string one' class ...
"""RCNN model """ import tensorflow as tf from define_scope import define_scope # custom decorators class Model: def __init__(self, X, y, output_size=None, learning_rate=1e-5, learning_rate_decay=0.95, reg=1e-5, dropout=0.5, verbose=False): """ Initalize the model. Inputs: - output_size: number of clas...
""" pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEXERS from pygme...
# 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 required by applicable law or ag...
<<<<<<< HEAD <<<<<<< HEAD import unittest from test.support import requires import tkinter as tk from tkinter import Text as tkText from idlelib.idle_test.mock_tk import Text as mkText from idlelib.IdleHistory import History from idlelib.configHandler import idleConf line1 = 'a = 7' line2 = 'b = a' class StoreTest(u...
import collections.abc as collections_abc import numbers import warnings from warnings import warn import numpy as np from scipy.sparse import csr_matrix from scipy.spatial.distance import cdist from menpo.transform import WithDims from .base import Shape def bounding_box(closest_to_origin, opposite_corner): r"...
#!/usr/bin/env python # coding=utf-8 import json import logging import requests from requests.compat import urljoin class Config(object): API_URL = 'https://api.mailjet.com/v3/REST/' API_DOC = 'http://dev.mailjet.com/email-api/v3/' API_PATHS = { # our_name:API_URL+part (http://dev.mailjet.com/email-api...
# -*- coding: utf-8 -*- # Copyright (c) 2016-present, CloudZero, Inc. All rights reserved. # Licensed under the BSD-style license. See LICENSE file in the project root for full license information. """ Main module used for enriching a resource, that is, discovering its properties and explicit relationships given its C...