gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2015: Mirantis 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... | |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | |
import json
import os
import re
from _sha256 import sha256
from typing import Dict
from ledger.genesis_txn.genesis_txn_file_util import create_genesis_txn_init_ledger
from libnacl import randombytes
from plenum.common import util
from plenum.common.signer_did import DidSigner
from plenum.common.util import rawToFrien... | |
# -*- coding: utf-8-*-
"""
The Mic class handles all interactions with the microphone and speaker.
"""
import logging
import tempfile
import wave
import audioop
import pyaudio
import alteration
import jasperpath
class Mic:
speechRec = None
speechRec_persona = None
def __init__(self, speaker, passive... | |
import typing as t
from collections import defaultdict
from functools import update_wrapper
from .scaffold import _endpoint_from_view_func
from .scaffold import _sentinel
from .scaffold import Scaffold
from .typing import AfterRequestCallable
from .typing import BeforeFirstRequestCallable
from .typing import BeforeReq... | |
import cPickle
import numpy as np
import sys
from collections import OrderedDict
def format_chars(chars_sent_ls):
max_leng = max([len(l) for l in chars_sent_ls])
to_pads = [max_leng - len(l) for l in chars_sent_ls]
for i, to_pad in enumerate(to_pads):
if to_pad % 2 == 0:
chars_sent_ls[i... | |
"""
Implementation of a fallback source using an external web service.
"""
from collections import defaultdict, namedtuple
import time
import colander
import numpy
from requests.exceptions import RequestException
from redis import RedisError
import simplejson
from ichnaea.api.schema import (
BoundedFloat,
In... | |
# Copyright 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 ... | |
#
# verilogParse.py
#
# an example of using the pyparsing module to be able to process Verilog files
# uses BNF defined at http://www.verilog.com/VerilogBNF.html
#
# Copyright (c) 2004-2011 Paul T. McGuire. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of th... | |
"""
Views show job status.
**Component**: views
:Macro: views
:Entry Point: jenkins_jobs.views
"""
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
def all_view(parser, xml_parent, data):
"""
All view
:arg bool filter-executors: only those build executors will be shown that
... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | |
# Copyright (c) 2013 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 ... | |
UIList = []
entry = {}
entry['name'] = 'giChannel'
entry['type'] = 'bool'
entry['displayName'] = 'GiChannel'
entry['default'] = 'false'
tab['entries'].append(entry)
entry = {}
entry['name'] = 'frameRate'
entry['type'] = 'int'
entry['displayName'] = 'FrameRate'
entry['default'] = '25'
tab['entries'].append(entry)
entry ... | |
#!/usr/bin/env python
# Copyright 2015 Hewlett-Packard Development Company, L.P.
# 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... | |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | |
# $Id$
#
# Copyright (C) 2008-2011 Greg Landrum
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import Chem
from rdkit import RDConfig... | |
"""
CCM Scoring Plugin
Author: Colin S. Maxwell
This plugin takes a grid of coordinates that mark out sub-images on
a larger image (e.g. wells of a 96-well plate) and crops the larger
image on those coordinates then displays the sub-images and records
a subjective score for each image. See README.org for usage.
"""
... | |
# 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... | |
"""Support for Yamaha MusicCast Receivers."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SU... | |
"""Setup script for Bokeh."""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENCE.txt, distributed with this software.
#---------... | |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | |
"Test calltip, coverage 60%"
from idlelib import calltip
import unittest
import textwrap
import types
default_tip = calltip._default_callable_argspec
# Test Class TC is used in multiple get_argspec test methods
class TC():
'doc'
tip = "(ai=None, *b)"
def __init__(self, ai=None, *b): 'doc'
__init__.t... | |
import numpy as np
import dicom
import glob
from matplotlib import pyplot as plt
import os
import cv2
from sklearn.metrics import confusion_matrix
import pandas as pd
from sklearn import cross_validation, metrics
import xgboost as xgb
import scipy.ndimage
from skimage import measure
from keras.applications.imagenet_... | |
# Copyright (c) 2013 eNovance , 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 requ... | |
"""OAuth 2.0 WSGI server middleware implements support for basic bearer
tokens and also X.509 certificates as access tokens
OAuth 2.0 Authorisation Server
"""
__author__ = "R B Wilkinson"
__date__ = "12/12/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file i... | |
#!/usr/bin/env python
'''
TracPy class
'''
import tracpy
import numpy as np
from matplotlib.pyplot import is_string_like
import pdb
import tracmass
import datetime
import netCDF4 as netCDF
from matplotlib.mlab import find
class Tracpy(object):
'''
TracPy class.
'''
def __init__(self, currents_filena... | |
# Copyright 2021 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
import sys, re, inspect, operator
import logging
from util import emit, name2label, plural, singular
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import sqlalchemy
from sqlalchemy import exc, and_
from sqlalchemy import MetaData, ForeignKeyConstraint
from sqlalchemy.ext... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | |
"""
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
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!
"""
import l... | |
import tcod as libt
import random
from components.ai import BasicMonster
from components.fighter import Fighter
from components.item import Item
from entity import Entity
from components.stairs import Stairs
from game_messages import Message
from item_functions import heal, cast_lightning, cast_fireball, cast_confus... | |
# -*- coding: utf-8 -*-
# vim: ts=2 sw=2 et ai
###############################################################################
# Copyright (c) 2012,2021 Andreas Vogel andreas@wellenvogel.net
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentatio... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
import logging, couchdb, oauth2, json, sys
from decorator import decorator
from pylons import config, request as r, response as res, session
from pylons.controllers.util import abort
from functools import wraps
log = logging.getLogger(__name__)
appConfig = config['app_conf']
class Error(RuntimeError):
"""Generic... | |
# Copyright 2015 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 ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to resolve double redirects, and to delete broken redirects.
Requires access to MediaWiki's maintenance pages or to a XML dump file.
Delete function requires adminship.
Syntax:
python pwb.py redirect action [-arguments ...]
where action can be one of these:
... | |
"""
Support for switches which integrates with other components.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.template/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.compo... | |
# -- coding: utf-8 --
from __future__ import absolute_import
from bs4 import BeautifulSoup
from urlparse import urlparse, urljoin
from re import search
from chime import repo_functions
class ChimeTestClient:
''' Stateful client for Chime Flask test client.
'''
def __init__(self, client, test):
'''... | |
#
# 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... | |
# Copyright 2014-2018 ARM Limited
#
# 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 w... | |
#!/usr/bin/env python
"""
electrum.py
This is a connector to Stratum protocol Electrum servers
For now, the main usage of this file is to grab the utxo's for a
given address.
UTXO's (Unspent Transaction Outputs) are the record of transactions
for an address that haven't been spent yet.
"""
from bitcoin.core import C... | |
# coding: utf-8
"""
Kubeflow Training SDK
Python SDK for Kubeflow Training # noqa: E501
The version of the OpenAPI document: v1.4.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubeflow.training.configuration import Configuration
class ... | |
#!/usr/bin/python
#
# dbce_api.py - a DBCE plugin for Vcycle
#
# THIS FILE NEEDS UPDATING FOR Vcycle 3.0 CHANGES!
#
# Andrew McNab, University of Manchester.
# Luis Villazon Esteban, CERN.
# Copyright (c) 2013-5. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modifi... | |
from django.shortcuts import render_to_response, redirect, render
from django.core.urlresolvers import reverse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST
from django_auth_lti.decorators import lti_role_required
from ab_tool.constants import (ADMINS, INTER... | |
# 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... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import nipype.interfaces.fsl as fsl # fsl
import nipype.interfaces.utility as util # utility
import nipype.pipeline.engine as pe # pypeline engine
import nipype.interfaces.f... | |
# 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 writi... | |
#! /usr/bin/env python
# encoding: utf-8
###############################################################################
#
# "filter_provisional_exome.py" Python script for GO2TR
# created by Jean P. Elbers
# jean.elbers@gmail.com
# last edited 22 November 2016
#
#######################################################... | |
from src.Piloto import Piloto
from src.Escuderia import Escuderia
from src.Circuito import Circuito
from src.CampeonatoMundial import CampeonatoMundial
from datetime import date
class Formula1(object):
"""
Modela una liga de formula 1
:author: Francisco Lopez Baena
:version: 1
"""
campeonatos... | |
"""Weight Boosting
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The ``BaseAdaBoost`` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each other in... | |
#!/usr/bin/env python
import sys
import math
from simtk.openmm.app import Element
import simtk.unit as unit
import subprocess
import datetime
from six.moves import cStringIO
import mdtraj as md
import logging
logger = logging.getLogger(__name__)
def fix(atomClass):
if atomClass == 'X':
return ''
retur... | |
"""
Soft Voting/Majority Rule classifier and Voting regressor.
This module contains:
- A Soft Voting/Majority Rule classifier for classification estimators.
- A Voting regressor for regression estimators.
"""
# Authors: Sebastian Raschka <se.raschka@gmail.com>,
# Gilles Louppe <g.louppe@gmail.com>,
# ... | |
#! /usr/bin/env jython
# Copyright (C) 2011 Sun Ning<classicning@gmail.com>
#
# 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... | |
from collections import Iterable
from numbers import Real, Integral
from xml.etree import ElementTree as ET
import sys
from six import string_types
import numpy as np
import openmc.checkvalue as cv
import openmc
from openmc.mixin import EqualityMixin
# "Static" variable for auto-generated and Mesh IDs
AUTO_MESH_ID ... | |
"""
Support for HydroQuebec.
Get data from 'My Consumption Profile' page:
https://www.hydroquebec.com/portail/en/group/clientele/portrait-de-consommation
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.hydroquebec/
"""
import asyncio
import loggin... | |
"""
Preliminary investigations of choosing c
"""
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import rnn_fxpts as rfx
import plotter as pltr
def c_path_traversal(W, a0, signs,
initial_dir_sign=1,
max_iters=2**16,
term_tol=2**-16,
initial_delta=2*... | |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | |
# 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 Li... | |
#! /usr/bin/env python
#
# Copyright 2014-2020 Bas C. Jansen
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... | |
#!/usr/bin/env python
"""
Binary task of cover song identification using the Millions Song Dataset
and the Second Hand Song dataset.
It takes the Million Song Dataset path as an argument.
The list of queries to test must be located in:
./SHS/list_500queries.txt
The training set of the Second Hand Song dataset must... | |
# -*- coding: utf-8 -*-
import datetime
import functools
import operator
import re
import pytz
from dateutil import parser
from django.utils import timezone
from modularodm import Q
from nose.tools import * # flake8: noqa
from rest_framework import serializers as ser
from unittest import TestCase
from tests.base... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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... | |
'''
:Authors: Sana Dev Team
:Version: 2.0
'''
import logging
from datetime import datetime
from django import forms
from django.forms.extras.widgets import SelectDateWidget
from .models import *
from .widgets import *
__all__ = ['ConceptForm', 'RelationshipForm', 'RelationshipCategoryForm',
'DeviceForm',... | |
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from .models import *
class CompanyForm(forms.ModelForm):
class Meta:
model = Company
fields = ('name', 'division', 'address', 'city',
'state_province', 'count... | |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Module provider for Infomaniak"""
import json
import logging
import requests
from lexicon.exceptions import AuthenticationError
from lexicon.providers.base import Provider as BaseProvider
LOGGER = logging.getLogger(__name__)
ENDPOINT = "https://api.infomaniak.com"
NAMESERVER_DOMAINS = ["infomaniak.com"]
def p... | |
import sys
import os
import re
import string
import imp
from itertools import count
from tkinter import *
import tkinter.simpledialog as tkSimpleDialog
import tkinter.messagebox as tkMessageBox
import traceback
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib 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 ... | |
from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises # flake8: noqa
from nose.tools import assert_raises
import boto3
import boto
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2, mock_ec2_... | |
# -*- coding: utf-8 -*-
"""
This module provides the step matchers functionality that matches a
step definition (as text) with step-functions that implement this step.
"""
from __future__ import absolute_import, print_function, with_statement
import copy
import os.path
import re
import parse
import six
from parse_type... | |
# transformers.py
# -*- coding: utf-8 -*-
from PIL import Image
from PIL.ImageFile import Parser
from PIL.ImageOps import mirror
from logging import getLogger
from loris_exception import LorisException
from math import ceil, log
from os import makedirs, path, unlink, devnull
from parameters import FULL_MODE
import cSt... | |
# -*- coding: utf-8 -*-
"""
lantz.drivers.legacy.pco.sensicam
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements Sensicam driver
Implementation Notes
--------------------
The Sensicam operates using a COC = Command Operation Code
---
:copyright: 2015 by Lantz Authors, see AUTHORS for mor... | |
# Copyright (c) 2016 EMC Corporation.
# 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... | |
"""
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One can use ... | |
import asyncio
import concurrent.futures
import getpass
import os
import re
import time
import types
import uuid
from functools import partial
from itertools import cycle
from concurrent.futures import ThreadPoolExecutor, as_completed
from uritools import urisplit
from socketIO_client import SocketIO
from lace import... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pickle
import textwrap
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from astropy.nddata.nddata import NDData
from astropy.nddata.nduncertainty import StdDevUncertainty
from ast... | |
#!/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... | |
# 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 ... | |
# Copyright 2013 Metacloud, Inc.
# 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 required ... | |
import numpy as np
from astropy.io import ascii
from emcee import EnsembleSampler
# Interpolators for temp and logg
import model_mag
import data_mag
# from deredden import av_point
from unred import A_lams
# Constants
pc = 3.086e18 # [cm]
R_sun = 6.96e10 # [cm]
L_sun = 3.9e33 # [erg/s]
M_sun = 1.99e33 # [g]
sigma_k =... | |
#
# 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... | |
from flask import request, jsonify, Blueprint, Response, flash
import flexget
from flexget.config_schema import resolve_ref, process_config, get_schema
from flexget.manager import manager
from flexget.options import get_parser
from flexget.plugin import plugin_schemas
from flexget.utils.tools import BufferQueue
API_V... | |
# -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2012 Timothy Farrell
# Import System Modules
import re
import sys
import socket
import logging
import traceback
from wsgiref.headers import Headers
from threading import Thread
from datetime import datetime
try:
from urllib impo... | |
"""
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One can use ... | |
"""Provide the basic bit-vector types."""
import math
from sympy.core import basic
class Term(basic.Basic):
"""Represent bit-vector terms.
Bit-vector terms are constants, variables and operations applied to terms.
Bit-vector terms support many operations with the standard
operators symbols (<=, +, ... | |
# Copyright 2016 NOKIA
#
# 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... | |
'''
XbrlSemanticSqlDB.py implements an SQL database interface for Arelle, based
on a concrete realization of the Abstract Model PWD 2.0 layer. This is a semantic
representation of XBRL information.
This module may save directly to a Postgres, MySQL, SQLite, MSSQL, or Oracle server.
This module provides the executi... | |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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.apach... | |
# -*- 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... | |
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import time
import logging
import threading
import random
from socket import error as SocketError
from hiredis import ReplyError
from retrying import retry
from redistrib.clusternode import Talker, pack_command, ClusterNode
from influxdb.client import Influ... | |
import logging
import os
import traceback
from collections import OrderedDict
from typing import Any, List, Optional, Tuple
import great_expectations.exceptions as exceptions
from great_expectations.core import ExpectationSuite
from great_expectations.core.util import nested_update
from great_expectations.data_context... | |
#
# Copyright (c) 2013-2016 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... | |
# -------------------------------------------------------------
#
# 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 unde... | |
import sys
import unittest
from six import b as b_
from webtest import TestApp
from pecan import expose, make_app
from pecan.secure import secure, unlocked, SecureController
from pecan.tests import PecanTestCase
try:
set()
except:
from sets import Set as set
class TestSecure(PecanTestCase):
def test_si... | |
import numpy as np
from scipy.spatial.distance import cdist
class gaussian_kde(object):
"""Representation of a kernel-density estimate using Gaussian kernels.
Kernel density estimation is a way to estimate the probability density
function (PDF) of a random variable in a non-parametric way.
`gaussian_k... | |
#!/usr/bin/python
# Copyright 2014 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.
"""Runs Closure compiler on a JavaScript file to check for errors."""
import argparse
import os
import re
import subprocess
import sys
imp... | |
import logging
import os
import sys
import threading
from logging.handlers import RotatingFileHandler
from typing import Callable
import ray
from ray._private.utils import binary_to_hex
_default_handler = None
def setup_logger(logging_level, logging_format):
"""Setup default logging for ray."""
logger = lo... | |
import ply.lex as lex
import sys
class Lexer(object): # Inheriting from object provides extra functionality
# List of keywords
keywords = (
# Logical Operator Keywords
'AND', 'OR', 'XOR',
# Branch Keywords
'IF', 'ELSE', 'ELSIF', 'UNLESS',
# Loop Keywords
'WHILE', 'UNTIL', 'FOR', 'FOR... | |
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import subprocess
import time
import platform
# if debug_info=True, Debugging Print Information will be turned on
debug_info=False
# if make_fal=True, Partition tables are put into firmware
make_fal=False
# Setting firmware output directory
out_path='./Bin'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.