gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import string
from sympy import (
Symbol, symbols, Dummy, S, Sum, Rational, oo, zoo, pi, I, simplify,
expand_func, diff, EulerGamma, cancel, re, im)
from sympy.functions import (
bernoulli, harmonic, bell, fibonacci, lucas, euler, catalan, binomial,
gamma, sqrt, hyper, log, digamma, trigamma, polygamma... | |
#!/usr/bin/env python
# Copyright (c) 2013 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=F0401
import operator
import optparse
import os
import re
import shutil
import subprocess
import sys
sys.path.appe... | |
# SDT2Parser.py
#
# Callback target class for the ElementTree parser to parse a SDT2
from .SDT2Classes import *
class SDT2Parser:
# Define the element tags of the SDT3
includeTag = 'include'
domainTag = 'domain'
importsTag = 'imports'
modulesTag = 'modules'
moduleClassTag = 'moduleclas... | |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <[email protected]>
# Tue May 31 16:55:10 2011 +0200
#
# Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
"""Tests on the machine infrastructure.
"""
import os, sys
import nose.tools
import math
import numpy
from . import M... | |
import docker
import pytest
from . import fake_api
from docker import auth
from .api_test import (
BaseAPIClientTest, fake_request, DEFAULT_TIMEOUT_SECONDS, url_prefix,
fake_resolve_authconfig
)
try:
from unittest import mock
except ImportError:
import mock
class ImageTest(BaseAPIClientTest):
de... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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... | |
# -*- coding: utf-8 -*-
"""Admin forms."""
from flask_wtf import Form
from wtforms.validators import DataRequired, Email, EqualTo, Length
from wtforms.widgets import html_params
from wtforms import BooleanField, StringField, TextAreaField, DateTimeField, PasswordField, SelectMultipleField
from flask_wtf.file import Fil... | |
import json
import os
from unittest import mock
import pytest
from click.testing import CliRunner
from great_expectations import DataContext
from great_expectations.cli.v012 import cli
from great_expectations.core.expectation_suite import ExpectationSuite
from great_expectations.util import filter_properties_dict
fro... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Custom filters for use in openshift-master
'''
import copy
import sys
from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error
from ansible import errors
from ansible.parsing.yaml.dumper import An... | |
"""
Calculate the type 2 Signal Detection Theory (SDT) measure meta-d' for the
S1 and S2 responses according to the method described in:
Maniscalco, B., & Lau, H. (2012). A signal detection theoretic approach
for estimating metacognitive sensitivity from confidence ratings.
Consciousness and Cognition, 21(1), 422-430.... | |
# 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... | |
# 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 -*-
"""Playlist model."""
from balistos.models.user import User
from datetime import datetime
from datetime import timedelta
from pyramid_basemodel import Base
from pyramid_basemodel import BaseMixin
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import DateTime
from s... | |
# Copyright (c) 2014 Quanta Research Cambridge, 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, merg... | |
"""
BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21).
Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPSe... | |
# 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 ... | |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | |
"""
The :mod:`findig.tools.counter` module defines the :class:`Counter` tool,
which can be used as a hit counter for your application. Counters can
count hits to a particular resource, or globally within the application.
"""
from abc import ABCMeta, abstractmethod
from collections import Counter as PyCounter, namedtu... | |
import collections
import functools
import math
from dimagi.utils import parsing as dateparse
from datetime import datetime, timedelta
from casexml.apps.stock import const
from casexml.apps.stock.models import StockTransaction
from dimagi.utils.dates import force_to_datetime
DEFAULT_CONSUMPTION_FUNCTION = lambda case_... | |
import os
import sys
import textwrap
import pytest
from tests.lib import (
assert_all_changes, pyversion, _create_test_package,
_change_test_package_version,
)
from tests.lib.local_repos import local_checkout
def test_no_upgrade_unless_requested(script):
"""
No upgrade if not specifically requested.... | |
import base64
import datetime
import logging
import os
import pickle
import re
import hiyapyco
import sarge
from simple_salesforce import Salesforce
import yaml
import requests
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
from github3 import login
from Crypto import Ra... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
#!/usr/bin/env python
from __future__ import print_function, unicode_literals
from pprint import pformat
from datetime import datetime, timedelta, date, time
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.management import call_command
from dateutil import rrule
import s... | |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | |
#!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <[email protected]>
#
# 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',
... | |
"""
Normal Django models with a few custom options for configuration.
If you have custom model classes that need these options, add them here and
create a child class of the appropriate options class and your custom model class.
"""
# Django
from django.db import models
class Options():
def __init__(self, di_sh... | |
#!/usr/bin/env python
import base64
import logging
import urllib.request, urllib.parse, urllib.error
import grequests
try:
import simplejson as json
except ImportError:
import json
log = logging.getLogger(__name__)
class CollinsClient:
"""
This client will help you interface with Collins in a meanin... | |
#!/usr/bin/env trial
import copy
import difflib
import logging
import mock
import os
import sys
from absl import flags as gflags
from ct.client import log_client
from ct.client.db import sqlite_connection as sqlitecon
from ct.client.db import sqlite_log_db
from ct.client import state
from ct.client import monitor
from... | |
#!/usr/bin/env python
# Copyright (c) 2011 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.
"""Shards a given test suite and runs the shards in parallel.
ShardingSupervisor is called to process the command line options and... | |
"""Z-Wave Constants."""
ATTR_NODE_ID = "node_id"
ATTR_VALUE_ID = "value_id"
ATTR_OBJECT_ID = "object_id"
ATTR_NAME = "name"
ATTR_SCENE_ID = "scene_id"
ATTR_BASIC_LEVEL = "basic_level"
ATTR_CONFIG_PARAMETER = "parameter"
ATTR_CONFIG_SIZE = "size"
ATTR_CONFIG_VALUE = "value"
NETWORK_READY_WAIT_SECS = 30
SERVICE_ADD_NOD... | |
# -*- coding: utf-8 -*-
#
# :copyright: (c) 2020 by Pavlo Dmytrenko.
# :license: MIT, see LICENSE for more details.
"""
yaspin.yaspin
~~~~~~~~~~~~~
A lightweight terminal spinner.
"""
from __future__ import absolute_import
import contextlib
import functools
import itertools
import signal
import sys
import threading... | |
# Copyright 2018 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 os
import unittest
import psycopg2
from vital.security import randhex
from cargo import db, Model as _Model, fields
from cargo.fields import *
from cargo.expressions import *
from cargo.statements import Insert
from cargo.builder import *
db.open()
def run_tests(*tests, **opts):
suite = unittest.TestSu... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
# Copyright DataStax, 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, softwa... | |
from unittest.mock import call, patch, Mock
import asyncio
import pytest
from . import FakeSleeper
from . import deadman_app
from . import mock_plugin
def fake_best_replicas(replicas):
l = sorted(replicas, key=lambda x: x[1]['willing'])
if l:
winner = l[0][1]['willing']
l = [i for i in l if ... | |
import logging
from django.contrib.auth import get_user_model
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.urls import reverse
from django.views.generic import CreateView, DetailView, TemplateView, UpdateView, View
from django_filters.rest_framework import DjangoFilterBackend
from i... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
from functools import partial
from collections import deque
from llvmlite import ir
from numba.core.datamodel.registry import register_default
from numba.core import types, cgutils
from numba.np import numpy_support
class DataModel(object):
"""
DataModel describe how a FE type is represented in the LLVM IR ... | |
"""Calculation of polygonal Field of View (FOV)"""
import functools
import py2d.Math
class Vision:
"""Class for representing a polygonal field of vision (FOV).
It requires a list of obstructors, given as line strips made of lists of vectors (i.e. we have a list of lists of vectors).
The vision polygon will be cac... | |
"""
A custom manager for working with trees of objects.
"""
from __future__ import unicode_literals
import contextlib
import django
from django.db import models, transaction, connections, router
from django.db.models import F, Max, Q
from django.utils.translation import ugettext as _
from mptt.exceptions import CantD... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def predict_rating(gender=None,
occupation=None,
zipcode=None,
title=None,
genres=None,
timestamp=None):
""" Predictor for rating from model/5ba500639252736dee002427
... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# 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 ... | |
"""Admin extensions for django-reversion."""
from __future__ import unicode_literals
from functools import partial
from django import template
from django.db import models, transaction, connection
from django.conf.urls import patterns, url
from django.contrib import admin
from django.contrib.admin import helpers, op... | |
from astropy.table import Table, join
from astropy.io import fits
from scipy.interpolate import griddata, RegularGridInterpolator
import pynrc, webbpsf, os
#inst = webbpsf.NIRCam()
outdir = pynrc.conf.path + 'opd_mod/'
# Read in measured SI Zernike data
data_dir = webbpsf.utils.get_webbpsf_data_path() + '/'
zernike_... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import os
import pytz
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
from trello.organization import Organization
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MEDIA_URL = "... | |
import unittest
import numpy
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer import utils
from chainer.utils import type_check
_scipy_available = True
try:
from scipy import sparse ... | |
from __future__ import absolute_import
from .events import WebhookAction
from .parsers import get_service_handler
def WebhookRequestHandlerFactory(config, event_store, server_status, is_https=False):
"""Factory method for webhook request handler class"""
try:
from SimpleHTTPServer import SimpleHTTPReq... | |
#!/usr/bin/env python2
#
# This script runs a set of black-box tests on Mailpile using the test
# messages found in `testing/`.
#
# If run with -i as the first argument, it will then drop to an interactive
# python shell for experimenting and manual testing.
#
import os
import sys
import time
import traceback
# Set u... | |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
import os
import click
from ..__about__ import __version__
from ..config.constants import AppEnvVars, ConfigEnvVars
from ..project.core import Project
from ..utils.ci import running_in_ci
from ..utils.fs import Path
from .application import Application
from .build import build
from .clean import clean
from .config im... | |
import unittest
import time
import random
import os
import signal
import asyncio
from unittest.mock import patch
import re
from collections import defaultdict
import json
import io
import aiohttp
from molotov.api import scenario, global_setup
from molotov.tests.support import (
TestLoop,
coserver,
dedicat... | |
#!/usr/bin/env python
"""
@package mi.dataset.parser
@file mi-dataset/mi/dataset/parser/camds.py
@author Dan Mergens
@brief Parser for camds_abc html files.
This file contains code for parsing CAMDS HTML formatted files, extracting the metadata associated therein and
generating the corresponding metadata particles.
... | |
from gevent.event import AsyncResult, Event
from gevent import Timeout
from pysteamkit.protobuf import steammessages_clientserver_pb2
from pysteamkit.steam_base import EMsg, EResult, EUniverse, EAccountType
from pysteamkit.steamid import SteamID
from pysteamkit.steam3 import msg_base
from pysteamkit.steam3.connection ... | |
from datetime import datetime, timedelta, time
from django.contrib.auth.models import AbstractUser
from django.contrib.postgres.fields import ArrayField
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.db.models.signals import post_save
from django.di... | |
#! /usr/local/bin/python
import numpy as np
from . import downcut
from .avulsion_utils import lowest_cell_elev, sort_lowest_neighbors
def lowest_neighbor(n, sub):
"""Find lowest neighbor value around a point.
Parameters
----------
n : ndarray
Grid of elevations.
sub : tuple of int
... | |
import sys, os
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(SCRIPT_DIR, '..'))
import json
import logging
import re
import sqlite3
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.websocket
from pysqrl import sqrl_conv
from pysqrl.server import ... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
import django.utils.timezone
from django.conf import settings
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency... | |
import warnings
import unittest as unittest
import numpy as np
from scipy.spatial import ConvexHull
from pymatgen import Composition
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.analysis.phase_diagram import PhaseDiagram, \
GrandPotentialPhaseDiagram
from pymatgen.analysis.reaction_cal... | |
# Authors: Alexandre Barachant <[email protected]>
# Asish Panda <[email protected]>
# Jean-Remi King <[email protected]>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
from .. import EvokedArray, Evoked
from ..cov import Covariance, _regularized_covar... | |
# -*- coding:utf-8 -*-
# This demo is based on O'reilly's website of Introduction to the t-SNE Algorithm
__author__ = "JOHNKYON"
# numpy and scipy imports
import numpy as np
from numpy import linalg
from numpy.linalg import norm
from scipy.spatial.distance import squareform, pdist
# sklearn(Everyone is using this)
... | |
# This script is licensed as public domain.
bl_info = {
"name": "Export Inter-Quake Model (.iqm/.iqe)",
"author": "Lee Salzman",
"version": (2019, 4, 24),
"blender": (2, 80, 0),
"location": "File > Export > Inter-Quake Model",
"description": "Export to the Inter-Quake Model format (.iqm/.iqe)",... | |
# Monary - Copyright 2011-2014 David J. C. Beach
# Please see the included LICENSE.TXT and NOTICE.TXT for licensing information.
import atexit
import copy
import ctypes
import os
import platform
import sys
PY3 = sys.version_info[0] >= 3
if PY3:
# Python 3.
bytes_type = bytes
string_type = str
from url... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | |
import numpy as np
import pandas as pd
from pandas import DataFrame
from collections import defaultdict
STATS_COLUMNS = ['_expanded_income', 'c00100', '_standard', 'c04470', 'c04600', 'c04800', 'c05200',
'c62100','c09600', 'c05800', 'c09200', '_refund', 'c07100',
'_ospctax','s006']
#... | |
import logging
import json
import multiprocessing
import os
import signal
from threading import Lock
import time
import tornado.httpserver
import tornado.netutil
import tornado.web
from zmq.eventloop import ioloop
from threading import Thread
from twisted.internet import reactor
from node import upnp
from node.db_sto... | |
"""
This module implements the Jobs class, which is intended to be a container-like
interface for all of the jobs defined on a single Jenkins server.
"""
import logging
import time
from jenkinsapi.job import Job
from jenkinsapi.custom_exceptions import JenkinsAPIException, UnknownJob
log = logging.getLogger(__name__)
... | |
# -*- coding: utf-8
# 'version': '0.3'
#
# Copyright (c) 2017, Stephen B, Hope, All rights reserved.
#
# CommAI-env Copyright (c) 2016-present, Facebook, Inc., All rights reserved.
# Round1 Copyright (c) 2017-present, GoodAI All rights reserved.
#
# This source code is licensed under the BSD-style license found in the... | |
# 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... | |
from __future__ import print_function
import httplib2
import os
import sys
import dateutil.parser as dateparse
try:
from apiclient import discovery
import oauth2client
from oauth2client import client
from oauth2client import tools
except ImportError:
print("""
Google API Modules are required:
pip i... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2016 MuLuu09
# 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/l... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyrig... | |
#from builtins import range
from collections import namedtuple
from datetime import datetime
import csv
import math
import time
import sys
import tensorflow.python.platform
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('batch_size', 128,
"""Batch size.""... | |
class Stamp:
def __init__(self, name):
self.name = name
self.number = 42
def __call__(self, something):
print("{0} was stamped by {1}".format(something, self.name))
print("number: " + str(self.number))
stamp = Stamp("The government")
stamp("That thing there") # That thing th... | |
XXXXXXXXX XXXXX
XXXXXX
XXXXXX
XXXXX XXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXX XXXXXXX X XXXXXX XX XXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXX... | |
from copy import copy
from sympy.tensor.array.dense_ndim_array import MutableDenseNDimArray
from sympy import Symbol, Rational, SparseMatrix, diff
from sympy.matrices import Matrix
from sympy.tensor.array.sparse_ndim_array import MutableSparseNDimArray
from sympy.utilities.pytest import raises
def test_ndim_array_in... | |
import hashlib
import binascii
import random
import time
import hmac
rng = random.SystemRandom()
def init_key_generation(keylengthbits):
if keylengthbits < 8:
keylengthbits = 8
elif keylengthbits % 8 != 0:
keylengthbits += ( 8 - keylengthbits % 8)
key = []
iters = keylengthbits // 8
for i in range(0,iters):
... | |
import base64
import imp
import os
import pickle
import sys
import tempfile
from StringIO import StringIO
from pygresql.pg import DatabaseError
from gparray import GpDB, GpArray, Segment
import shutil
from mock import *
from gp_unittest import *
from gphostcache import GpHost
db_singleton_side_effect_list = []
def... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module to run optimzer modeller with differents number of measures.
The aim is to visualize the minimal number of measures witch maintains the
model error at acceptable limits
usage: parsecpy_runmodel_errors [-h] -p PARSECPYDATAFILEPATH
... | |
"""Unit tests for VLAN"""
import unittest
from ipaddress import ip_address, ip_network, ip_interface
from faucet.vlan import VLAN
class FaucetVLANBaseTest(unittest.TestCase): # pytype: disable=module-attr
"""Set up defaults for VLAN tests"""
def setUp(self):
"""Defines the default config - this sho... | |
#!/usr/bin/env python
"""This module provides tools for making parallel dirsig runs.
Public Repository:
https://github.com/pavdpr/DIRSIG/
USAGE:
python parallel.py [options] or
parallel.py [options] If execute permissions on parallel.py and it is
in the ... | |
# coding=utf-8
from datetime import date, datetime, timedelta
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q
from djang... | |
# Copyright (c) 2015 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
"Definitions of fields in APT.txt"
APT_RECORDS = (
('record_type', 3),
('facility_site_number', 11),
('facility_type', 13),
('location_identifier', 4),
('information_effective_date', 10),
('faa_region_code', 3),
('faa_district_office_code', 4),
('associated_state_post_office_code', 2),
... | |
# -*- coding: utf-8 -*-
import datetime
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django... | |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import datetime
from dateutil import tz as tzutil
import json
import logging
import os
import re
import time
import uuid
from collections import OrderedDict
from botocore.exceptions import Cli... | |
# Copyright 2010 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 l... | |
# 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 ... | |
import socket
from .BTcrypto import Crypto, CRYPTO_OK, padding
from .Encrypter import protocol_name, option_pattern
CHECK_PEER_ID_ENCRYPTED = True
# header, reserved, download id, my id, [length, message]
class NatCheck(object):
def __init__(self, resultfunc, downloadid, peerid, ip, port, rawserver,
... | |
# -*- coding: utf-8 -*-
# Copyright 2020 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 ... | |
"""Crust combines the shell and filling into one control."""
__author__ = "Patrick K. O'Brien <[email protected]>"
__cvsid__ = "$Id$"
__revision__ = "$Revision$"[11:-2]
import wx
import os
import pprint
import re
import sys
import dispatcher
import editwindow
from filling import Filling
import frame
from shell im... | |
"""Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
import asyncio
from enum import Enum
from functools import partial
import logging
import voluptuous as vol
from homeassistant.components.fan import (
FanEntity,
PLATFORM_SCHEMA,
SUPPORT_SET_SPEED,
DOMAIN,
)
from homeassistant.const... | |
import os.path, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
import json
import falcon
import urllib
import uuid
import settings
import requests
from geopy.geocoders import Nominatim
import geopy.distance
from geopy.distance import vincenty
import datetime
radius = []
radius... | |
import weakref
import asyncio
from asyncio import CancelledError
import traceback
from functools import partial
import logging
logger = logging.getLogger("seamless")
def print_info(*args):
msg = " ".join([str(arg) for arg in args])
logger.info(msg)
def print_warning(*args):
msg = " ".join([str(arg) for ... | |
from __future__ import absolute_import
import unittest
from tinyquery import lexer
plus = ('PLUS', '+')
minus = ('MINUS', '-')
star = ('STAR', '*')
divided_by = ('DIVIDED_BY', '/')
mod = ('MOD', '%')
equals = ('EQUALS', '=')
doubleequals = ('EQUALS', '==')
not_equal = ('NOT_EQUAL', '!=')
greater_than = ('GREATER_TH... | |
import sys
from decimal import Decimal
import numpy as np
from numpy.testing import *
from numpy.testing.utils import WarningManager
import warnings
class TestEinSum(TestCase):
def test_einsum_errors(self):
# Need enough arguments
assert_raises(ValueError, np.einsum)
assert_raises(ValueErr... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Main snapshotter module
Snapshotter creates an immutable scope around an object (e.g. Audit) where
snapshot object represent a join between parent object (Audit),
child object (e.g. Control, Regulation, ... | |
# -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
#from pysqlite2 import dbapi2 as sqlite
import sqlite3 as sqlite
import re
import math
def getwords(doc):
splitter=re.compile('\\W*')
#print doc
# Split the words by non-alpha characters
words=[s.lower() for s in splitter.split(doc)
if len(s)>2 and len(s)<20]
# Return the unique set of words on... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.