gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2014 Technische Universitaet Berlin
# 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
#
# U... | |
# 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... | |
# Copyright 2013, Big Switch 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 applic... | |
# Copyright (C) 2016 Atsushi Togo
# All rights reserved.
#
# This file is part of phono3py.
#
# 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
# noti... | |
# -*- coding: utf-8 -*-
# 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 require... | |
import requests
from cStringIO import StringIO
import csv
import json
DEFAULT_LIMIT = 1000
MAX_LIMIT = 50000
DEFAULT_OFFSET = None
__author__ = "Cristina Munoz <hi@xmunoz.com>"
class Socrata(object):
def __init__(self, domain, app_token, username=None, password=None,
access_token=None, session_... | |
""" ArcGIS python toolboxes for ``propagator``.
This contains Classes compatible with ArcGIS python toolbox
infrastructure.
(c) Geosyntec Consultants, 2015.
Released under the BSD 3-clause license (see LICENSE file for more info)
Written by Paul Hobson (phobson@geosyntec.com)
"""
from functools import partial
fr... | |
"""This module contains a collection of unit tests which
validate the ..tor_async_google_pubsub module.
"""
import httplib
import unittest
import uuid
import mock
from . import AsyncHTTPClientPatcher
from .. import tor_async_google
from .. import tor_async_google_pubsub
class AsyncActionTestCase(unittest.TestCase)... | |
#!/usr/bin/env python
"""The various output plugins for GenericHunts."""
import csv
import threading
import urllib
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import export
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import renderi... | |
import json
import logging
import os
import socket
import StringIO
import django
from django.conf import settings
from django.contrib.sites.models import Site
from django.http import (HttpResponsePermanentRedirect, HttpResponseRedirect,
HttpResponse, Http404)
from django.shortcuts import rende... | |
#!/usr/bin/env python
import re,os
from exceptions import IndexError
from optparse import OptionParser
import ConfigParser
import numpy as N
import numpy.fft as FT
from scipy.optimize import brentq,fmin,anneal
try:
import tables
HAS_TABLES=True
except:
HAS_TABLES=False
def write_parameter_file(filename)... | |
import os
from nose.plugins.skip import SkipTest
if os.name == "nt":
raise SkipTest("Skipped on Windows.")
import sys
import libmproxy.console.contentview as cv
from libmproxy import utils, flow, encoding
import tutils
try:
import pyamf
except ImportError:
pyamf = None
try:
import cssutils
except:
... | |
from django.db.models import Q
from django.contrib import messages
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.views.generic import ListView, DetailView, DeleteView, \
UpdateView, FormView
from django.views.ge... | |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
import datetime
import logging
from optparse import make_option
# Django
from django.core.management.base import NoArgsCommand, CommandError
from django.db import transaction
from django.utils.timezone import now
# AWX
from awx.main.models import (
... | |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mw_wav2dat.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from qtpy import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWi... | |
from __future__ import absolute_import, print_function, division
from abc import abstractmethod, ABCMeta
import six
from typing import List # noqa
from mitmproxy import filt
from mitmproxy import models # noqa
@six.add_metaclass(ABCMeta)
class FlowList(object):
def __init__(self):
self._list = [] # ... | |
# coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | |
# Copyright (c) 2013 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... | |
import os
import time
import socket
from resource import getrusage, RUSAGE_SELF
from twisted.application.service import Service
from twisted.internet.task import LoopingCall
from carbon.conf import settings
stats = {}
prior_stats = {}
HOSTNAME = socket.gethostname().replace('.', '_')
PAGESIZE = os.sysconf('SC_PAGESI... | |
"""Figure 5 - Goal zone enrichment by place cells"""
FIG_FORMAT = 'svg'
circ_var_pcs = False
MALES_ONLY = False
import matplotlib as mpl
if FIG_FORMAT == 'svg':
mpl.use('agg')
elif FIG_FORMAT == 'pdf':
mpl.use('pdf')
elif FIG_FORMAT == 'interactive':
mpl.use('TkAgg')
import matplotlib.pyplot as plt
import... | |
import csv
from urllib.request import Request, urlopen
import dateutil.parser
import re
from os import system
from sys import argv
from bs4 import BeautifulSoup
from datetime import date
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
default_sale = default_sale[0]
report_path = 'mar... | |
import pytest
from samplics.sampling import SampleSize, allocate
region = ["Dakar", "Kaolack", "Ziguinchor"]
pop_size = {"Dakar": 500, "Kaolack": 300, "Ziguinchor": 200}
@pytest.mark.xfail(reason="stratum is required")
def testation_equal_stratum_error():
allocate(method="equal")
def testation_equal():
s... | |
# 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... | |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Utilities for running tests.
"""
import os
import random
import tempfile
import time
import unittest
from typing imp... | |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ul... | |
# Copyright 2015, 2016 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.0
#
# Unless require... | |
"""Preliminary socket module.
XXX Restrictions:
- Only INET sockets
- No asynchronous behavior
- No socket options
- Can't do a very good gethostbyaddr() right...
"""
import java.net
import org.python.core
import jarray
import string
__all__ = ['AF_INET', 'SOCK_DGRAM', 'SOCK_RAW', 'SOCK_RDM', 'SOCK_SEQPACKET',
... | |
from matplotlib import pyplot
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pyplot import cm
import numpy as np
from sklearn.cluster import KMeans
from sklearn.cluster import MiniBatchKMeans
import time
from scipy.sparse import csr_matrix
from scipy.optimize import nnls
from sklearn.preprocessing import norm... | |
#-*- coding: utf-8 -*-
""" .
,-. ,-. ,-. ,-. ,-. | *
| | ,-| | `-. |-' | |
|-' `-^ ' `-' `-' `' '
|
parseli
~~~~~~~
Crawler and Parser for LinkedIn which retrieves and consumes HTML
pages, extracts key values and converts them to dict (json) output
:copyright: (c)... | |
# GamePlay 3D Blender Scene Viewer
#
# Copyright 2013 Ithai Levi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import six
from datetime import datetime
from .. import errors
from .. import utils
from ..constants import DEFAULT_DATA_CHUNK_SIZE
from ..types import (
CancellableStream, ContainerConfig, EndpointConfig, HostConfig,
NetworkingConfig
)
class ContainerApiMixin(object):
@utils.check_resource('container')
... | |
# 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... | |
from math import cos, sin
import numpy as np
from OpenGL.GL import *
from PyEngine3D.Utilities import *
from PyEngine3D.App import CoreManager
from PyEngine3D.OpenGLContext import CreateTexture, Texture2D, Texture3D, FrameBuffer
from PyEngine3D.Render import ScreenQuad
from .Constants import *
def CieColorMatching... | |
#!/usr/bin/python
# ############################################################################ #
# NetJobs - a network job scheduler. #
# #
# Author: Ramon A. Lovato (ramonalovato.com) ... | |
#!/usr/bin/env python
import os
from copy import deepcopy
import numpy as np
from numpy.testing import assert_array_equal
import gippy as gp
import unittest
import gippy.test as gpt
class GeoImageTests(unittest.TestCase):
prefix = 'test-'
def setUp(self):
""" Configure options """
gp.Option... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Josh Durgin
# 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/lic... | |
"""Painless animated sprites which are pygame.sprite.Sprite objects.
Animated sprites are loaded from GIF, but there will be other ways
very soon! When using an AnimatedSprite you must remember to update
it every main loop iteration with timedelta:
>>> AnimatedSprite.from_gif('example.gif') # doctest: +SKIP
>>> ... | |
# 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... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis as vv
import numpy as np
import OpenGL.GL as gl
from visvis.processing.statistics import StatData
# todo: enable notch in boxp... | |
# Copyright 2019 Google LLC. 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... | |
#! /usr/bin/env python
#
# (C) 2001-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
Multi-port serial<->TCP/IP forwarder.
- RFC 2217
- check existence of serial port periodically
- start/stop forwarders
- each forwarder creates a server socket and opens the serial port
- serial p... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, timedelta
import numpy as np
from pandas.compat import lrange
from pandas import (DataFrame, Series, Index, MultiIndex,
RangeIndex)
import pandas as pd
from pandas.util.testing import (assert_series_equ... | |
# 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, unicode_literals
import re
from aspen import Response
import pytest
from gratipay.security.user import SESSION
from gratipay.testing import Harness
from gratipay.wireup import find_files
overescaping_re = re.compile(r'&(#[0-9]{4}|[a-z]+);')
class TestPages(Harness):
... | |
"""
Zappa Async Tasks
Example:
```
from zappa.async import task
@task(service='sns')
def my_async_func(*args, **kwargs):
dosomething()
```
For SNS, you can also pass an `arn` argument to task() which will specify which SNS path to send it to.
Without `service='sns'`, the default service is 'lambda' which will c... | |
# 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... | |
# Copyright 2022 The MT3 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 writ... | |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | |
# Time-stamp: <2015-03-01 06:13:00 Ryo KOBAYASHI>
"""
Routines related to neural network.
"""
import math,time,os
import numpy as np
import multiprocessing as mp
#.....import from local modules
import fitpot
#.....constants which may be different from those in fitpot.py
_large= 1.0e+30
#.....global variables
_l1st... | |
# 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 th... | |
# encoding=utf8
import datetime
from distutils.version import StrictVersion
import hashlib
import os.path
import shutil
import socket
import sys
import time
import random
import string
import seesaw
from seesaw.config import NumberConfigValue
from seesaw.externalprocess import ExternalProcess
from seesaw.item import I... | |
import numpy as np
import tensorflow as tf
import h5py
from sklearn.preprocessing import OneHotEncoder
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
import scipy.io
# Functions for initializing neural nets parameters
def weight_variable(shape, var_name):
initial = tf.truncated... | |
# -*- coding: utf-8 -*-
u"""WARP execution template.
:copyright: Copyright (c) 2015-2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from opmd_viewer import OpenPMDTimeSeries
from opmd_viewer.openpmd... | |
# 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... | |
# Standard python modules.
import time
import sys
# citest modules.
import citest.gcp_testing as gcp
import citest.json_predicate as jp
import citest.service_testing as st
# Spinnaker modules.
import spinnaker_testing as sk
import spinnaker_testing.gate as gate
import citest.base
class GoogleServerGroupTestScenario... | |
from __future__ import absolute_import
import time
from celery import group, subtask, Task
from celery.utils.log import get_task_logger
from scdown.celery import app
from scdown.sc import (USER, USER_TRACKS,
USER_FOLLOWINGS, USER_FOLLOWERS,
USER_WEB_PROFILES,
... | |
from django.apps.registry import apps as global_apps
from django.db import migrations, router
from .exceptions import InvalidMigrationPlan
from .loader import MigrationLoader
from .recorder import MigrationRecorder
from .state import ProjectState
class MigrationExecutor:
"""
End-to-end migration execution - ... | |
"""
A module of deep feature selection based on multilayer perceptrons.
This module applies a deep structure with not too many hidden layers.
Thus, stochastic gradient descent (back-prop) is used in optimization.
Copyright (c) 2008-2013, Theano Development Team All rights reserved.
Yifeng Li
CMMT, UBC, Vancouver
Sep... | |
# Copyright 2016 Intel Corporation
#
# 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... | |
#!/usr/bin/python
#
# azure_api.py - an Azure plugin for Vcycle
#
# THIS FILE NEEDS UPDATING FOR Vcycle 3.0 CHANGES!
#
# Andrew McNab, University of Manchester.
# Luis Villazon Esteban, CERN.
# Copyright (c) 2013-7. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without mod... | |
import os
import subprocess
from collections import OrderedDict
import cothread
from annotypes import Anno
from malcolm import __version__
from malcolm.core import (
Alarm,
AlarmSeverity,
BadValueError,
ProcessStartHook,
ProcessStopHook,
StringMeta,
Widget,
)
from malcolm.modules import bu... | |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: IpAddr.py
class IpAddr:
IPADDR_TYPE_IPV4 = 0
IPADDR_TYPE_IPV6 = 1
def __init__(self):
import array
self.m_ipv4 = 0
... | |
"""
Support for firewalld.
.. versionadded:: 2015.2.0
"""
import logging
import re
import salt.utils.path
from salt.exceptions import CommandExecutionError
log = logging.getLogger(__name__)
def __virtual__():
"""
Check to see if firewall-cmd exists
"""
if salt.utils.path.which("firewall-cmd"):
... | |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import unicodedata
import datetime
import re
import time
from pytz import UTC
from .enums import ResourceType
from .permissions import Permissions
EPOCH_DT = datetime.datetime.fromtimestamp(0, UTC)
... | |
# 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... | |
from zope.interface import implementer
from node.ext.uml.interfaces import (
ModelIllFormedException,
IPackage,
IUMLElement,
IAction,
IActivity,
IActivityEdge,
IActivityFinalNode,
IActivityNode,
IBehavior,
IConstraint,
IControlNode,
IDecisionNode,
IFinalNode,
IFlo... | |
import os
import logging
import datetime
import webapp2
from google.appengine.api import memcache
from google.appengine.ext import ndb
from google.appengine.ext.webapp import template
import tba_config
from base_controller import CacheableHandler
from consts.event_type import EventType
from consts.notification_type ... | |
# 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... | |
# Copyright (c) 2013-2019 Philip Hane
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from future.utils import PY2
import logging
import re
import sys
from datetime import datetime
from path import Path
from flexget import plugin
from flexget.config_schema impo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Plecost: Wordpress vulnerabilities finder
#
# @url: http://iniqua.com/labs/
# @url: https://github.com/iniqua/plecost
#
# @author:Francisco J. Gomez aka ffranz (http://iniqua.com/)
# @author:Daniel Garcia aka cr0hn (http://www.cr0hn.com/me/)
#
# Copyright (c) 2015, Iniqua T... | |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of data model for SVC monitor
"""
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from cfgm_common.vnc_db import DBBase
from cfgm_common import svc_info
class DBBaseSM(DBBase):
obj_type = __name__
... | |
# ===============================================================================
# Copyright 2014 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | |
#!/usr/bin/env python
'''
This is the "course" curriculum development workflow tool. Run "course help"
for complete documentation.
'''
import os
import sys
import bdc
import re
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from termcolor import colored
from string import Template as Str... | |
import numpy as np
from scipy.special import expi, gammainc
from .ssp_basis import SSPBasis
__all__ = ["CSPBasis", "StepSFHBasis", "CompositeSFH", "LinearSFHBasis"]
# change base
from .constants import loge
class CSPBasis(object):
"""
A class for composite stellar populations, which can be composed from
... | |
"""Channels module for Zigbee Home Automation."""
import asyncio
from typing import Any, Dict, List, Optional, Tuple, Union
import zigpy.zcl.clusters.closures
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_send
from . import ( # noqa: F401 # pylint: disable=unu... | |
# Copyright 2015, Radware 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 required by ap... | |
from decimal import *
from dataactcore.models.validationModels import RuleSql
from dataactvalidator.validation_handlers.validationError import ValidationError
from dataactcore.interfaces.interfaceHolder import InterfaceHolder
from dataactcore.utils.cloudLogger import CloudLogger
class Validator(object):
"""
Ch... | |
#!/usr/bin/env python
from kazoo.client import KazooClient
from urllib2 import *
import os
import logging
import json
import argparse
import time
class LeaderCore(object):
def __init__(self, collection, shard, shard_range, core_name, node_name, node_port, core_dir):
self.collection = collection
... | |
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import utils
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.models import aggregates, fields
from django.db.models.expressions import Col
from django.utils imp... | |
"""
Script to verify all examples in the readme.
Simply execute
python test_readme_examples.py
The tests in this file are currently not unittests!
They do plot images.
TODO move this to checks/ ?
"""
from __future__ import print_function, division
import functools
def main():
example_simple_training_setti... | |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | |
from tapiriik.database import db, cachedb, redis
from tapiriik.messagequeue import mq
from tapiriik.services import Service, ServiceRecord, APIExcludeActivity, ServiceException, ServiceExceptionScope, ServiceWarning, UserException, UserExceptionType
from tapiriik.settings import USER_SYNC_LOGS, DISABLED_SERVICES, WITHD... | |
"""
Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
"""
import subprocess
import filecmp
import os
import nose.tools
import json
from conf import const
def print_debug_msg(sid=0, msg=""):
"""
provide gen... | |
from sympy import (
symbols, log, ln, Float, nan, oo, zoo, I, pi, E, exp, Symbol,
LambertW, sqrt, Rational, expand_log, S, sign, conjugate, refine,
sin, cos, sinh, cosh, tanh, exp_polar, re, Function, simplify,
AccumBounds)
def test_exp_values():
x, y = symbols('x,y')
k = Symbol('k', integer... | |
import argparse
import os
import sys
import textwrap
import configargparse
import locust
version = locust.__version__
DEFAULT_CONFIG_FILES = ["~/.locust.conf", "locust.conf"]
def _is_package(path):
"""
Is the given path a Python package?
"""
return os.path.isdir(path) and os.path.exists(os.path.j... | |
#
# 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... | |
"""Xbox Media Source Implementation."""
from dataclasses import dataclass
from typing import List, Tuple
from pydantic.error_wrappers import ValidationError # pylint: disable=no-name-in-module
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.api.provider.catalog.models import FieldsTemplate, Image
f... | |
import logging
from decimal import Decimal as D
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse... | |
from datetime import datetime, timedelta
import socket
from twisted.web import resource, static
from twisted.application.service import IServiceCollection
from scrapy.utils.misc import load_object
from .interfaces import IPoller, IEggStorage, ISpiderScheduler
from six.moves.urllib.parse import urlparse
class Roo... | |
# Copyright (c) 2015 Orange.
# 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... | |
# -*- coding: utf-8 -*-
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('microdevices', '0001_initial'),
('cellsamples', '0001_initial'),
... | |
import re
from itertools import count
from xml.sax.saxutils import quoteattr
from django.conf import settings
from html5lib import HTMLParser
from html5lib.serializer.htmlserializer import HTMLSerializer
from html5lib.treebuilders import getTreeBuilder
from html5lib.treewalkers import getTreeWalker
from lxml.etree im... | |
# 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 ... | |
"""Copyright 2014 Cyrus Dasadia
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
distr... | |
import os
from typing import Callable
from typing import cast
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
from typing import Union
from . import autogenerate as autogen
from . import util
from .runtime.environment import EnvironmentContext
from .script import ScriptDirectory
i... | |
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
"""
CIE Chromaticity Diagrams Plotting
==================================
Defines the *CIE* chromaticity diagrams plotting objects:
- :func:`colour.plotting.plot_chromaticity_diagram_CIE1931`
- :func:`colour.plotting.plot_chromaticity_diagram_CIE1960UCS`
- :func:`colour.plotting.plot_chromaticity_diagram_CIE197... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.