gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
"""
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");... | |
# -*- coding: utf-8 -*-
from .. import base
from girder.models.collection import Collection
from girder.models.file import File
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.user import User
class SetupDatabaseTestCase(base.TestCase):
def testAdmin(self):
a... | |
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | |
"""This library brings support for forked_daapd to Home Assistant."""
import asyncio
from collections import defaultdict
import logging
from pyforked_daapd import ForkedDaapdAPI
from pylibrespot_java import LibrespotJavaAPI
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.compone... | |
#!/usr/bin/env python
"""
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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
... | |
#!/usr/bin/env python
# PyQt tutorial 13
import sys
import math
import random
from PySide import QtCore, QtGui
class LCDRange(QtGui.QWidget):
def __init__(self, text=None, parent=None):
if isinstance(text, QtGui.QWidget):
parent = text
text = None
QtGui.QWidget.__init__... | |
"""Support for HomeMatic devices."""
from datetime import timedelta
from functools import partial
import logging
import socket
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_NAME, CONF_HOST, CONF_HOSTS, CONF_PASSWORD,
CONF_PLATFORM, CONF_SSL, CONF_USERNAME, CONF_VERIFY_SSL,
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... | |
# 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... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import py_utils
from systrace import trace_result
from systrace import tracing_agents
class FtraceAgentIo(object):
@staticmeth... | |
# 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.
import unittest
from telemetry import decorators
import mock
class FakePlatform(object):
def GetOSName(self):
return 'os_name'
def GetOSVersionNa... | |
# 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 a... | |
# Copyright 2012 IBM Corp.
#
# 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 t... | |
# 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... | |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import xml.dom.minidom as minidom
import os
# import PIL
import numpy ... | |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | |
# package org.apache.helix.manager.zk
#from org.apache.helix.manager.zk import *
#from java.io import File
#from java.util import ArrayList
#from java.util import Arrays
#from java.util import Collections
#from java.util import HashMap
#from java.util import List
#from java.util import Map
#from java.util.concurrent im... | |
import glob
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
# TODO:
# 1. Set min/max value for every frame in AnimationScene
# See http://www.paraview.org/pipermail/paraview/2011-September/022682.html
#
LoadPlugin('/Users/schmitt/paraview/paraview... | |
#!/usr/bin/python2.4
#
# Copyright 2011 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... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... | |
import logging
import math
import copy
import os
import pickle
import warnings
from collections.abc import Iterable
import numpy as np
from astropy.io import fits
from astropy.table import Table
from astropy.logger import AstropyUserWarning
import matplotlib.pyplot as plt
import stingray.utils as utils
from .utils i... | |
import os
import sys
import subprocess
import datetime
import numpy as np
from astropy.io import ascii
from astropy.table import Table, Column, vstack
from astropy.wcs import WCS
from astropy.wcs.utils import proj_plane_pixel_scales
from astropy.coordinates import SkyCoord, ICRS
from astropy.stats import gaussian_fwhm_... | |
"""Support for Denon Network Receivers."""
import logging
import telnetlib
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SUPPORT_PR... | |
#
# Copyright (c) 2013-present, Anoop Kunchukuttan
# All rights reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
import codecs, sys
from indicnlp.script import indic_scripts as si
import re
chillu_char_map= {
... | |
import unittest
from ctypes import *
from ctypes.test import need_symbol
from struct import calcsize
import _ctypes_test
import test.support
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
class X(Structure):
_fields_ = [("a", c_int)]
class Y(X):
_fields_ ... | |
# 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.
import fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from teleme... | |
# 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 2009-2010 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
#!/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... | |
#!/usr/bin/env python
#
# $Id: //depot/main/platform/kosmosfs/scripts.solaris/kfsfsck.py#0 $
#
# Copyright 2008 Quantcast Corp.
#
# This file is part of Kosmos File System (KFS).
#
# Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You ... | |
# Django settings for ancfindersite project.
import sys
sys.path.append("lib")
import os.path
RECAPTCHA_PUBLIC_KEY = '6LeYAO8SAAAAALEZqtnk4qm7hoh8Iwv_h4lZ3lSe'
RECAPTCHA_PRIVATE_KEY = '6LeYAO8SAAAAAICslEpPIpmMmkFiuNs_hrAzSRxx'
environment_file = '/home/ancfinder/environment.yaml'
if not os.path.exists(environment_... | |
# coding=utf-8
"""
Persistence.
"""
# Copyright (c) 2015 Stefan Braun
#
# 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... | |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
""" interactive debugging with PDB, the Python Debugger. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import pdb
import sys
from doctest import UnexpectedException
from _pytest import outcomes
from _pytest.config import hookimpl
def... | |
#!/usr/bin/python
"""
PinkWave is a pentesting tool for linux which can be used to test (web)servers with Python scripts and Selenium.
usage ./pinkwave.py -t [target] -e [pathToExploit] [parameters]
for a full list, start help:
./pinkwave.py --help
use automate.py if you would like to run multiple tests via a JSON ... | |
"""
kombu.entity
================
Exchange and Queue declarations.
"""
from __future__ import absolute_import
from .abstract import MaybeChannelBound
from .exceptions import ContentDisallowed
from .serialization import prepare_accept_content
TRANSIENT_DELIVERY_MODE = 1
PERSISTENT_DELIVERY_MODE = 2
DELIVERY_MODES = ... | |
#!/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 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
import os, shutil, glob, winreg
from os import path
def mtime(f):
try:
stat = os.stat(f)
return stat.st_mtime
except:
return 0
def unglob(src, files):
out = []
for f in files:
if '*' in f:
for o in glob.iglob(path.join(src, f)):
out.append(o[len(src)+1:])
else: out.append(f)
return out
def copy... | |
# -*- coding: utf-8 -*-
"""
Query classes for Tokyo Tyrant API implementation.
"""
import copy
import warnings
from protocol import TyrantProtocol
import utils
CACHE_CHUNK_SIZE = 1000
class Query(object):
"""
A lazy abstraction for queries via Tyrant protocol.
You will normally instantiate Query thi... | |
from django.contrib import messages
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, get_object_or_404
from django.utils.text import slugify
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.core.urlresolvers import reverse
from django.utils import ... | |
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
import math
import sys
import scipy
import scipy.optimize
from scipy.stats.mstats import mquantiles as quantiles
import scipy.stats
### New: added possibility to use emcee for MCMCs
try:
import emcee
# import acor
... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2012 VMware, 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 Lice... | |
#! /usr/env/python
"""
Component that models 2D diffusion using an explicit finite-volume method.
Created July 2013 GT
Last updated May 2015 DEJH
"""
##############DEJH is unsure if the uplift is correctly (not) incorporated here
from __future__ import print_function
from landlab import ModelParameterDictionary,... | |
"""Configuration object and defaults setup
The PylonsConfig object is initialized in pylons projects inside the
:file:`config/environment.py` module. Importing the :data:`config`
object from module causes the PylonsConfig object to be created, and
setup in app-safe manner so that multiple apps being setup avoid
confl... | |
from django import forms
from django.forms import extras
import datetime
from mptt.forms import TreeNodeChoiceField
from education.utils import is_empty
from poll.models import Poll
from rapidsms.contrib.locations.models import Location
from generic.forms import ActionForm, FilterForm, ModuleForm
from mptt.forms import... | |
from __future__ import division, absolute_import
import numpy as np
from copy import deepcopy
from fatiando import utils, gridder
from mesher import OblateEllipsoid
import oblate_ellipsoid
from numpy.testing import assert_almost_equal
from pytest import raises
# Local-geomagnetic field
F = 30000
inc = 2
dec = -27
gm... | |
# -*- coding: utf-8 -*-
"""
Created on Mon May 07 14:20:11 2018
@author: m.meliani
Adapted to new SMT version in march 2020 by Nathalie Bartoli
"""
import matplotlib
matplotlib.use("Agg")
import unittest
import numpy as np
import unittest
import inspect
from collections import OrderedDict
from smt.problems impor... | |
#!/usr/bin/python
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_func... | |
# 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... | |
import copy
from Cython.Compiler import (ExprNodes, PyrexTypes, MemoryView,
ParseTreeTransforms, StringEncoding,
Errors)
from Cython.Compiler.ExprNodes import CloneNode, ProxyNode, TupleNode
from Cython.Compiler.Nodes import (FuncDefNode, CFuncDefNode, StatList... | |
import time
from unittest import mock
import pytest
from globus_sdk.authorizers.renewing import EXPIRES_ADJUST_SECONDS, RenewingAuthorizer
class MockRenewer(RenewingAuthorizer):
"""
Class that implements RenewingAuthorizer so that _get_token_response and
_extract_token_data can return known values for t... | |
__author__ = 'chris'
from binascii import unhexlify
import mock
import nacl.signing
import nacl.hash
from txrudp import packet, connection, rudp, constants
from twisted.internet import udp, address, task
from twisted.trial import unittest
from dht.crawling import RPCFindResponse, NodeSpiderCrawl, ValueSpiderCrawl
from... | |
import pytest
import json
import six
from textwrap import dedent
from nbformat.v4 import new_output
from ...preprocessors import DisplayAutoGrades
from .base import BaseTestPreprocessor
from .. import (
create_code_cell, create_text_cell)
@pytest.fixture
def preprocessor():
return DisplayAutoGrades()
@pytes... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, 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
#
... | |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
"""Base class extended by connection adapters. This extends the
connection.Connection class to encapsulate connection behavior but still
isolate socket and low level communication.
"""
import errno
import logging
import socket
import ssl
from pika import connection
from pika import exceptions
try:
SOL_TCP = sock... | |
import argparse
import multiprocessing
import multiprocessing.pool
import sys
import random
from sklearn.linear_model import LogisticRegression
from sklearn.externals import joblib
from api import State, util
from bots.ml.ml import features
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
colors = {... | |
# coding: utf-8
#
# Copyright 2016 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... | |
from __future__ import absolute_import
from sentry.grouping.api import get_default_grouping_config_dict, load_grouping_config
from sentry.stacktraces.processing import (
find_stacktraces_in_data,
normalize_stacktraces_for_grouping,
)
from sentry.testutils import TestCase
class FindStacktracesTest(TestCase):
... | |
import typing
import enum
import io
import collections
import click
import json
from dataclasses import dataclass
from typing import List, Dict, TypeVar, Union, Generic, Optional
from ontobio.validation import metadata
from ontobio.io import assocparser
from ontobio.io import gafparser
from ontobio.io import assocwri... | |
"""Implementation of OpenGL errors/exceptions
Note that OpenGL-ctypes will also throw standard errors,
such as TypeError or ValueError when appropriate.
ErrorChecker is an _ErrorChecker instance that allows you
to register a new error-checking function for use
throughout the system.
"""
import OpenGL, logging
log = ... | |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | |
# -*- coding: utf-8 -*-
'''
Module for handling openstack keystone calls.
:optdepends: - keystoneclient Python adapter
:configuration: This module is not usable until the following are specified
either in a pillar or in the minion's config file::
keystone.user: admin
keystone.password: verybadp... | |
from __future__ import print_function, division
import numpy as np
import pandas as pd
from os.path import join
import nilmtk
from nilmtk.disaggregate import CombinatorialOptimisation, fhmm_exact
from neuralnilm.metrics import run_metrics, across_all_appliances
import yaml
import matplotlib.pyplot as plt
ukdale = nilm... | |
import json
import re
from collections import defaultdict
from datetime import datetime
import yara
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_jsonfield_backport.models import JSO... | |
"""The Tasmota integration."""
from __future__ import annotations
import asyncio
import logging
from hatasmota.const import (
CONF_IP,
CONF_MAC,
CONF_MANUFACTURER,
CONF_MODEL,
CONF_NAME,
CONF_SW_VERSION,
)
from hatasmota.discovery import clear_discovery_topic
from hatasmota.models import Tasmo... | |
# 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... | |
# 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 ... | |
"""Defines the unit tests for the :mod:`colour.plotting.diagrams` module."""
import unittest
from matplotlib.pyplot import Axes, Figure
from colour.colorimetry import (
MSDS_CMFS,
SDS_ILLUMINANTS,
SpectralShape,
reshape_msds,
)
from colour.plotting import (
plot_chromaticity_diagram_CIE1931,
p... | |
# -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
import pytest
from pandas.compat import PY3, range, u
import pandas as pd
from pandas import Float64Index, Index, Int64Index, RangeIndex, Series
import pandas.util.testing as tm
from .test_numeric import Numeric
class TestRangeIndex(Numeric... | |
# -*- coding: utf-8 -*-
"""
.. module:: djstripe.fields.
:synopsis: dj-stripe Custom Field Definitions
.. moduleauthor:: Bill Huneke (@wahuneke)
"""
import decimal
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.core.validators import MaxValueValidator, MinValueValidator
from djan... | |
# Copyright 2015 Metaswitch Networks
#
# 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 python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | |
from __future__ import division
import os, sys
import logging
import logging.handlers
import httplib, httplib2
import urllib
import re
import base64
from xml.dom import minidom
import time
from collections import deque
import shutil
import pprint
import base64
import threading
import copy
# The max number of threads s... | |
#!/usr/bin/python3
# Copyright (c) 2017 Johannes Leupolz
#
# 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, modif... | |
import asyncio
import logging
import threading
import tkinter as tk
import tkinter.ttk as ttk
from tkinter import filedialog, messagebox
import webbrowser
import json
from modis.tools import data, config
logger = logging.getLogger(__name__)
class Frame(ttk.Frame):
"""A tab containing the core controls of the bo... | |
import os
import sys
import subprocess
import six
import plistlib
from bento.compat.api \
import \
check_call
BENTO_INFO = "0.0.5"
MKBOM = "/usr/bin/mkbom"
def _unicode(*args, **kw):
if six.PY3:
return str(*args, **kw)
else:
return unicode(*args, **kw)
def path_requirement(Spe... | |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
"""
Amazon mobi format output
Publishing Guidelines:
http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf
Tools:
http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621
(KindleGen and Kindle Previewer)
This still needs a lot of work.
"""
from .output import OutputFile
from ... | |
# -*- coding: utf-8 -*-
"""
:mod:`pambox.inner` regroups processes of the inner ear.
"""
from __future__ import absolute_import, division, print_function
import numpy as np
from numpy import exp, sin, cos, sqrt, abs, ones, pi
import scipy as sp
import scipy.signal as ss
from .utils import next_pow_2, hilbert
try:
... | |
import random, csv
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from itertools import chain,cycle,islice
def roundrobin(*iterables):
"roundrobin('ABC', 'D', 'EF') --> A D E B F C"
# Recipe credited to George Sakkis
pending = len(iterables)
nexts = cycle(iter(it).next for it in... | |
"""
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 collections
import multiprocessing
import pyes
from pyes.exceptions import NotFoundException
import pymongo
import logging
import time
from bson.objectid import ObjectId
from .spec import QuerySpecification
from .oplog_watcher import OplogWatcher
import base64
_indexes = []
_connections = {}
class IndexMeta(t... | |
import json
import logging
from unittest import mock
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core import mail
from django.core.mail import EmailMultiAlternatives
from django.test import TestCase, override_settings
from django.urls import reverse
from freez... | |
from mock import call, ANY
from nose.tools import istest
from provy.more.debian import UserRole
from tests.unit.tools.helpers import ProvyTestCase
example_groups = """
root
daemon
bin
sys
adm
tty
disk
lp
mail
"""
example_users = """
root
daemon
bin
sys
sync
games
man
lp
mail
"""
example_groups_for_user = """
foo : fo... | |
# This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import date, datetime, time, timedelta
import pytest
from indico.core.db.sqlalchemy.protec... | |
#!/usr/bin/env python
'''
This module implements a simple and naive Gramps XML file (.gramps) parser.
Author: Chris Laws
'''
from __future__ import unicode_literals
from future.builtins import str
import datetime
import dateutil.parser
import gzip
import logging
try:
from xml.etree import cElementTree as etree
... | |
import struct
import hashlib
import subprocess
import re
from binascii import hexlify, unhexlify
from seth.args import args, hexdump
from seth.consts import TERM_PRIV_KEY
class RC4(object):
def __init__(self, key):
x = 0
self.sbox = list(range(256))
for i in range(256):
x = (x ... | |
# -*- 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'.
# Modified for wxPython Pheonix 3.0.0.0
# Keith Smith 15 Oct 2013
""" The WX backend.
"""
# NOTICE: wx has the same general problem with Op... | |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... | |
#!/usr/bin/python
import Settings
import bs4
from datetime import datetime
import xml.etree.ElementTree as ET
import traceback
import sys
import os
import os.path
from xml.dom import minidom
######################################
def prettify(elem):
"""Return a pretty-printed XML string for the Element.
"""
rou... | |
import datetime
import functools
import json
import os
import sys
from typing import Any, Optional, cast
from unittest import mock
import freezegun # type: ignore
import pytest
from pip._vendor.packaging.version import parse as parse_version
from pip._internal import self_outdated_check
from pip._internal.models.can... | |
import warnings
import pytest
from pandas._config import config as cf
from pandas._config.config import OptionError
import pandas as pd
class TestConfig:
@classmethod
def setup_class(cls):
from copy import deepcopy
cls.cf = cf
cls.gc = deepcopy(getattr(cls.cf, "_global_config"))
... | |
"""
Command line interface to RR.
"""
import argparse
import datetime
from .active import ActiveRR
from .brrr import BestRace
from .crrr import CoolRunning
from .csrr import CompuScore
from .nyrr import NewYorkRR
def run_active():
the_description = 'Process Active race results'
parser = argparse.ArgumentPar... | |
#!/usr/bin/env python
# inspired by - http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/runxpcshelltests.py
import sys, os, os.path, signal, re
import jsshellhelper
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
# Uses jsshell https://developer.mozilla.org/en/Introduction_to_... | |
#
# Copyright 2014 Cisco Systems,Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
# -*- coding: utf-8 -*-
"""
@name: new_program.py
@vers: 0.1.0
@author: dthor
@created: Tue Dec 30 12:46:46 2014
@descr: A new file
Usage:
new_program.py
Options:
-h --help # Show this screen.
--version # Show version.
"""
from __future__ import ... | |
"""Tests for classes defining properties of ground domains, e.g. ZZ, QQ, ZZ[x] ... """
from sympy import S, sqrt, sin, oo, nan, Poly, Integer, Rational
from sympy.abc import x, y, z
from sympy.polys.domains import (ZZ, QQ, RR, CC, FF, GF,
PolynomialRing, FractionField, EX)
from sympy.polys.rings import ring
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.