gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import unicode_literals import os from django.utils import six from djblets.webapi.errors import (INVALID_ATTRIBUTE, INVALID_FORM_DATA, PERMISSION_DENIED) from reviewboard import scmtools from reviewboard.diffviewer.models import DiffSet from reviewboard.webapi.erro...
import functools from typing import List, Any import numpy as np import scipy.sparse as sp import pytest from sklearn.metrics import euclidean_distances from sklearn.random_projection import johnson_lindenstrauss_min_dim from sklearn.random_projection import _gaussian_random_matrix from sklearn.random_projection im...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010 OpenStack LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # htt...
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
import heisenberg.self_similar.kh import heisenberg.self_similar.plot import itertools import numpy as np import pathlib import typing import vorpy.realfunction.piecewiselinear def plot_LogSize_and_Euclidean (t__v:np.ndarray, qp_ls__t:np.ndarray, qp_r3__t:np.ndarray, plot__p:pathlib.Path) -> None: qp_ls = heisenbe...
import tables import itertools from ..core import CUBA from ..core.data_container import DataContainer from ..cuds import ABCParticles, ABCMesh, ABCLattice from .h5_particles import H5Particles from .h5_mesh import H5Mesh from .h5_lattice import H5Lattice H5_FILE_VERSION = 3 class H5CUDS(object): """ Access to ...
""" Test offset.BusinessHour._next_opening_time and offset.BusinessHour._prev_opening_time """ from datetime import datetime import pytest from pandas._libs.tslibs.offsets import BusinessHour class TestOpeningTimes: # opening time should be affected by sign of n, not by n's value and end opening_time_cases ...
from __future__ import with_statement import copy from functools import partial from operator import isMappingType import os import sys from contextlib import contextmanager from fudge import Fake, patched_context, with_fakes from nose.tools import ok_, eq_ from fabric.decorators import hosts, roles, task from fabri...
# 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 python3 # import sys import numpy as np from Scanner import Scanner class InterPyter(): def __init__(self, input_ = ''): #{--------------------------------------------------------------} #{ python class defaults } self.scanner = Scanner() self.scanner.ScanLine(input_...
# -*- coding: utf-8 -*- """ Utilities to set-up a Raiden network. """ from __future__ import print_function, division import copy from ethereum import slogging from raiden.app import App from raiden.network.discovery import Discovery from raiden.network.transport import DummyPolicy from raiden.utils import privatekey...
from bs4 import BeautifulSoup import requests from trawler.browsers import exceptions from trawler.browsers.utils import start_browser import logging import random, time from trawler.settings import AVAILABLE_METHODS, DEFAULT_MAX_PAGES from user_agent import generate_user_agent from datetime import datetime logging.ge...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function from .._errors import pretty_message from .._ffi import ( buffer_from_bytes, bytes_from_buffer, deref, new, null, pointer_set, struct, struct_bytes, unwrap, write_to_buffer, ) from...
# Copyright (c) 2012 NetApp, 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...
"""API for Home Connect bound to HASS OAuth.""" from asyncio import run_coroutine_threadsafe import logging import homeconnect from homeconnect.api import HomeConnectError from homeassistant import config_entries, core from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_ICON, CONF_DEVICE, CONF_...
########################### # Latent ODEs for Irregularly-Sampled Time Series # Authors: Yulia Rubanova and Ricky Chen ########################### import os import lib.utils as utils import numpy as np import tarfile import torch from torch.utils.data import DataLoader from torchvision.datasets.utils import download_...
"""Functions for generating a project from a project template.""" import fnmatch import json import logging import os import shutil import warnings from collections import OrderedDict from binaryornot.check import is_binary from jinja2 import FileSystemLoader from jinja2.exceptions import TemplateSyntaxError, Undefine...
# 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 ...
""" rb_stack 1.0: A (less and less) simple stack class. Copyright (C) 2000 Gordon Worley. To contact me, please visit my Web site at <http://www.rbisland.cx/> or e-mail me at <redbird@rbisland.cx>. History: 1.0 - Added trigonometric functions and inverse. 0.9 - Updated for Python 2.0. Uses the new self modifying m...
#!/usr/bin/env python3 # Quick and dirty PEG generator. import pprint import sys pp = pprint.PrettyPrinter(indent=4) def generate_parsers(input_filename, output_filename): with open(input_filename, 'r') as f: peg = f.read() tokens = tokenise(peg) #pp.pprint(tokens) named_parsers = [] r...
import csv import hashlib import inspect import logging from numbers import Number from namespace import * import codecs import os import petl as etl import re from loader.prefixes import PREFIX_LANGUAGE, PREFIX_MULTIMEDIA from lxml import etree from petl.util.base import Table from rdflib import Literal, RDF, RDFS, ...
# Copyright 2011 VMware, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
""" Helper views for the debug toolbar. These are dynamically installed when the debug toolbar is displayed, and typically can do Bad Things, so hooking up these views in any other way is generally not advised. """ import os import django.views.static from django.conf import settings from django.http import HttpRespon...
# 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. # --------------------------------------------------------------------...
# -*- coding: utf-8 -*- import hashlib import inspect import os import posixpath import re import subprocess from ..helpers import argument from ..helpers import option from .command import Command from .completions.templates import TEMPLATES class CompletionsCommand(Command): name = "completions" descript...
############################################################################### ## ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary forms, with or without ## modification, ...
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
# Copyright 2014 Objectif Libre # Copyright 2015 DotHill Systems # # 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 # # U...
import error, decimal class handler: def flag_handler(self): if self.flag_const: i = 0 while self.imem[i] != 0: i+=1 if self.indentlvl == 0: value = self.i.split("const ")[-1].replace("\n","") else: value = self.char_data[self...
# -*- coding: utf-8 -*- # Copyright 2012 splinter 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 re from lxml.cssselect import CSSSelector from zope.testbrowser.browser import Browser, ListControl from splinter.element_list i...
from collections import deque import logging import nghttp2 import urllib from urllib.parse import urlparse, parse_qs import io import paho.mqtt.client as mqtt import paho.mqtt.publish as publish import asyncio LOG = logging.getLogger(__name__) loop = asyncio.get_event_loop() def _topic_translation(key, translation=s...
from __future__ import absolute_import # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Ver...
# 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...
"""Interactive debugging with PDB, the Python Debugger.""" import argparse import functools import sys import types from typing import Any from typing import Callable from typing import Generator from typing import List from typing import Optional from typing import Tuple from typing import Type from typing import TYPE...
#!/usr/bin/env python import numpy as np import os, sys, netCDF4 import argparse ap=argparse.ArgumentParser() ap.add_argument('-m') # mesh file ap.add_argument('-p') # problem number ap.add_argument('-d') # absolute output 1 # Exodus mesh file fin= ap.parse_args().m # SCEC problem index idcase=int(ap.parse_args().p) i...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: set ts=2 sw=2 noet: import sys #TODO: Handle other langauges collins_mapping_table = { 'ADJP': ('right', ['NNS', 'QP', 'NN', '$', 'ADVP', 'JJ', 'VBN', 'VBG', 'ADJP', 'JJR', 'NP', 'JJS', 'DT', 'FW', 'RBR', 'RBS', 'SBAR', 'RB']), 'ADVP': ('left', ['RB', 'RBR', '...
from collections import OrderedDict from django.conf import settings from django.db.models import Count, F from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404 from drf_yasg import openapi from drf_yasg.openapi import Parameter from drf_yasg.utils import swagger_auto_schema from...
# Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copi...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
# Copyright (c) 2015 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
#!/usr/bin/python import copy from . import wgwidget as widget from . import wgtextbox as textbox import textwrap import curses from . import wgtitlefield as titlefield from . import fmPopup as Popup import weakref import collections import copy MORE_LABEL = "- more -" # string to tell user there a...
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn from operator import attrgetter import numpy as np from scipy.sparse import issparse, csc_matrix from ...
"""Cloudhands database and security models. The data model for Cloudhands is heavily subclassed using the concept of multi-table inheritance. For example, a large number of the models are subclassed from the Resource class. This usefully represents the fact that an actor or artifact can have a variety of resources ass...
# orm/attributes.py # Copyright (C) 2005-2013 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 """Defines instrumentation for class attributes and their interaction with instances...
import requests import json import time from collections import OrderedDict from test_framework.test_framework import OpenBazaarTestFramework, TestFailure class OutOfInventoryTest(OpenBazaarTestFramework): def __init__(self): super().__init__() self.num_nodes = 3 def run_test(self): ...
"""Demo platform for the vacuum component.""" import logging from homeassistant.components.vacuum import ( ATTR_CLEANED_AREA, STATE_CLEANING, STATE_DOCKED, STATE_IDLE, STATE_PAUSED, STATE_RETURNING, SUPPORT_BATTERY, SUPPORT_CLEAN_SPOT, SUPPORT_FAN_SPEED, SUPPORT_LOCATE, SUPPORT_PAUSE, SUPPORT_RETURN_HOME, ...
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this sof...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from optparse import make_option from collections import OrderedDict from importlib import import_module import itertools import traceback from django.apps import apps from django.core.management import call_command from django.core.management.base import...
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """POSIX specific tests.""" import datetime import os import subprocess import sys import time import psutil from psutil import BS...
from common import * from dataset.mask import * CARVANA_DIR = '/home/chicm/ml/kgdata/kaggle-carvana-cars-2017' CARVANA_NUM_VIEWS = 16 CARVANA_HEIGHT = 1280 CARVANA_WIDTH = 1918 CARVANA_H = 512 CARVANA_W = 512 #data iterator ---------------------------------------------------------------- class KgCarDataset...
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """NaCl SDK tool SCons.""" import __builtin__ import re import os import shutil import sys import SCons.Scanner import SCons.Scri...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import six import logging import traceback from . import Command from ..benchmarks import Benchmarks from ..console imp...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
# Copyright (c) 2014 Huawei Technologies Co., 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 # # ...
# sql/operators.py # Copyright (C) 2005-2015 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 # This module is part of SQLAlchemy and is released under # the MIT License: http:/...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
#!/usr/bin/env python import os import sys import argparse import struct import re from operator import attrgetter class CommaSplitAppend(argparse.Action): def __init__(self, option_strings, dest, nargs=None, **kwargs): if nargs is not None: raise ValueError("nargs not allowed") super(...
# -*- coding: utf-8 -*- # Django settings import os.path from os import environ import environ as envmax env = envmax.Env() from django.template.defaultfilters import slugify PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DEBUG = True # serve media through the staticfiles app. SERVE_ME...
# Copyright (c) 2011 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 ...
######## # Copyright (c) 2015 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...
# -*- coding: utf-8 -*- """ Graphs is a simple log viewer using matplotlib to create tracks of log data. Allows graphically editing curve data through manual changes and bulk shifting. """ import os import gc import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import xml.etree.ElementTree as ...
"""Support for Tibber sensors.""" import asyncio import logging from datetime import timedelta import aiohttp from homeassistant.components.tibber import DOMAIN as TIBBER_DOMAIN from homeassistant.exceptions import PlatformNotReady from homeassistant.helpers.entity import Entity from homeassistant.util import dt as ...
"""Tests for the Config Entry Flow helper.""" from unittest.mock import patch, Mock import pytest from homeassistant import config_entries, data_entry_flow, setup from homeassistant.helpers import config_entry_flow from tests.common import ( MockConfigEntry, MockModule, mock_coro, mock_integration, ...
#!/usr/bin/env python # # $Id$ # # Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """FreeBSD platform implementation.""" import errno import os import _psutil_bsd import _psutil_posix import ...
# -*- coding: utf-8 -*- import math from vaex.dataset import Dataset from vaex.ui.qt import * import logging logger = logging.getLogger("vaex.table") PAGE_LIMIT = int(1e7) class FullTableModel(QtCore.QAbstractTableModel): def __init__(self, dataset, page_size, page, parent=None, *args): """ :ty...
"""Test the TcEx API Module.""" # standard library import os from datetime import datetime, timedelta from random import randint # third-party import pytest # first-party from tcex.api.tc.v3.tql.tql_operator import TqlOperator from tests.api.tc.v3.v3_helpers import TestV3, V3Helper class TestCases(TestV3): """T...
# Copyright 2011 VMware, Inc # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
# Copyright 2019 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 (c) 2017-2021 F5 Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# $Id: io.py 7864 2015-04-12 09:57:05Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ I/O classes provide a uniform API for low-level input and output. Subclasses exist for a variety of input/output mechanisms. """ __docformat__ = 'reStructured...
import re from inspect import signature from typing import Optional import pytest from sklearn.utils._testing import all_estimators numpydoc_validation = pytest.importorskip("numpydoc.validate") # List of whitelisted modules and methods; regexp are supported. DOCSTRING_WHITELIST = [ "LogisticRegression$", "L...
from opcodes import opcodes, reverse_opcodes import utils import serpent import rlp import copy code_cache = {} OUT_OF_GAS = -1 GDEFAULT = 1 GMEMORY = 1 GSTORAGE = 100 GTXDATA = 5 GTXCOST = 500 TT255 = 2 ** 255 TT256 = 2 ** 256 TT256M1 = 2 ** 256 - 1 TT160 = 2 ** 160 TT160M1 = 2 ** 160 - 1 # Converts an unsigned va...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: addressbook.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflectio...
""" Custom transformers for scikit-learn. These are helpful for constructing pipelines. """ from typing import Dict from typing import FrozenSet from typing import Iterable from typing import Optional from typing import Set import numpy as np from sklearn.base import BaseEstimator from sklearn.exceptions import NotFi...
#!/usr/bin/env python3 """ACL IRB Test Case HLD: **config** - L2 MAC learning enabled in l2bd - 2 routed interfaces untagged, bvi (Bridge Virtual Interface) - 2 bridged interfaces in l2bd with bvi **test** - sending ip4 eth pkts between routed interfaces - 2 routed interfaces - 2 bridg...
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
#!/usr/bin/env python """ This program takes a vcf input and converts the VCF file to a fasta file containing all the relevant information for further analysis. In humans only one such problem exists with an indel being called in a different place on the reference sequence. """ import vcf, argpars...
"""Fixed policy. Encodes fixed policies for particular domains.""" from rlpy.Tools import vec2id from .Policy import Policy import numpy as np from rlpy.Tools import randSet, className __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["Alborz Geramifard", "Robert H. Klein", "Christoph Dann"...
import struct from .dtab import Dtab class Status(object): OK = 0 ERROR = 1 NACK = 2 class Message(object): # Application messages T_REQ = 1 R_REQ = -T_REQ T_DISPATCH = 2 R_DISPATCH = -T_DISPATCH # Control messages T_DRAIN = 64 R_DRAIN = -T_DRAIN T_PING = 65 R_PING = -T_PING T_DISCA...
"""Controller of Quota Indicator.""" import sys from lib.mvc.quota_indicator.model import QuotaIndicatorModel, QuotaState from lib.mvc.quota_indicator.view import QuotaIndicatorView from lib.helpers import sys_call, get_path, getuid from lib.mvc.bases import ControllerBase from lib.exception_feedback import add_defaul...
#!/usr/bin/env python ########################################################################### # obd_gui.py # # Created by Paul Bartek (pbartek@cowfishstudios.com) # ########################################################################### #--------------------------------------------------------------------------...
# Copyright (c) 2006, Mayuresh Phadke # 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 o...
import h5py import numpy as np import pandas as pd from PIL import Image from sklearn.datasets import make_blobs from sklearn.metrics import log_loss from sklearn.preprocessing import MinMaxScaler # ---------------------------------------------------------------------- # Preprocess data # ---------------------------...
# -*- coding: utf-8 -*- from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_paypal.controllers.main import PaypalController from openerp.tools import mute_logger from lxml import objectify import u...
"""Module otsun.optics Implementation of optical effects on rays """ from FreeCAD import Base import numpy as np from .math import arccos, myrandom, one_orthogonal_vector, correct_normal, \ parallel_orthogonal_components, rad_to_deg, normalize from enum import Enum from numpy.lib.scimath import sqrt from autologg...
import re from django.contrib.gis import forms from django.contrib.gis.forms import BaseGeometryWidget from django.contrib.gis.geos import GEOSGeometry from django.forms import ValidationError from django.test import SimpleTestCase, override_settings from django.test.utils import patch_logger from django.utils.html im...
""" Locations resource for querying location data """ import json from flask import jsonify, g, request from flask_restful import Resource, abort, reqparse from sqlalchemy import func, or_ from meerkat_abacus import model from meerkat_abacus.util import is_child, get_locations from meerkat_api.authentication import a...
import os import pytest import unittest from mock import patch, MagicMock from oxdpython.client import Client, Configurer, Timer from oxdpython.exceptions import OxdServerError, InvalidTicketError, \ NeedInfoError, InvalidRequestError this_dir = os.path.dirname(os.path.realpath(__file__)) initial_config = os.pa...
# Copyright (c) 2017 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from builtins import open, range import os import tempfile import shutil from tempfile import mkdtemp from shutil import rmtree import nump...
""" 2014-05-16 from modifiedMexicanHatTest11d.py """ # step 1 ####################################################################### import numpy as np import matplotlib.pyplot as plt from scipy import ndimage from scipy import interpolate sigmasWRF = [1, 2, 4, 5, 8, 10, 16, 20, 32, 40, 64, 80, 128, 160, 256...
from datetime import date from decimal import Decimal from ssl import SSLError from suds import WebFault from suds.client import Client from authorize.exceptions import AuthorizeConnectionError, \ AuthorizeInvalidError, AuthorizeResponseError PROD_URL = 'https://api.authorize.net/soap/v1/Service.asmx?WSDL' TEST...
""" HTML Widget classes """ import copy import datetime import re import warnings from itertools import chain from django.conf import settings from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats from django.utils.dates import...
"""Functions for handling the network rules directory files.""" import errno import logging import os import re from treadmill import firewall from treadmill import fs _LOGGER = logging.getLogger(__name__) _DNAT_FILE_PATTERN = ( '{chain}:dnat:' '{proto}:{src_ip}:{src_port}:{dst_ip}:{dst_port}-{new_ip}:{ne...
# Copyright 2020 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 or agreed to in writing...
# Copyright 2015 Dell 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...
# pylint: disable=missing-docstring import hashlib from io import BytesIO from pathlib import Path from typing import Any from typing import Optional import pytest from flask import g from flask import url_for from fava.core.charts import dumps from fava.core.misc import align def assert_api_error(response, msg: Op...
#!/opt/datadog-agent/embedded/bin/python ''' Datadog www.datadoghq.com ---- Make sense of your IT Data Licensed under Simplified BSD License (see LICENSE) (C) Boxed Ice 2010 all rights reserved (C) Datadog, Inc. 2010-2016 all rights reserved ''' # set up logging before importing any other c...
# Copyright (C) 2013 eNovance SAS <licensing@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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
import requests from . import log from .constants import DEFAULT_CONFLUENCE_API_VERSION def create_confluence_api(version, url, session): # Documentation for different REST API versions: https://docs.atlassian.com/confluence/REST/ confluence_api_class = None if version == DEFAULT_CONFLUENCE_API_VERSION: ...