gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# -*- coding: utf-8 -*-
""" Sahana Eden Guided Tour Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 w... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""PyTest fixtures"""
import pytest # pylint: disable=import-error
from lib import constants
from lib.page.widget import info_widget
from lib.constants.test import batch
from lib.service.rest_service imp... | |
import os
####### Database config. This assumes Postgres #######
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'commcarehq',
'USER': os.environ['POSTGRES_ENV_POSTGRES_USER'],
'PASSWORD': os.environ['POSTGRES_ENV_POSTGRES_PASSWORD'],
... | |
#!/usr/bin/env python
from collections import namedtuple
import hashlib
import math
import unittest
from ct.crypto import error
from ct.crypto import merkle
class TreeHasherTest(unittest.TestCase):
sha256_empty_hash = ("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495"
"991b7852b855... | |
#!/usr/bin/env python
import multiprocessing
#import concurrent.futures
import logging
import weakref
import functools
import claripy
import sys
from ..sim_state import SimState
l = logging.getLogger("angr.surveyor")
#
# Surveyor debugging
#
STOP_RUNS = False
PAUSE_RUNS = False
def enable_singlestep():
global... | |
"""Unit test for lvm - Linux Volume Manager
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shutil
import tempfile
import unittest
import mock
import treadmill
from treadmill import lvm
class ... | |
"""
NOTE: for now this is just intended to be run as python -m tests from the
compiler directory (parent directory of this file).
"""
import logging
import os
import select
import subprocess
import unittest
class CompilerTestBase(unittest.TestCase):
"""Contains the code that actually runs tests and reports their... | |
from django.contrib.auth import get_user_model
from rest_framework import status
from datetime import datetime, timedelta
from time import sleep
from coupons.tests.base import BasicTest
class CouponRedeemTests(BasicTest):
def setUp(self):
u = get_user_model()
u.objects.create_superuser('admin', ... | |
import pytest
from tests.utils import async
import io
import os
import json
import base64
import hashlib
import aiohttpretty
from waterbutler.core import streams
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
from waterbutler.core.provider import build_url
from waterbutle... | |
#!/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
# "L... | |
"""
Unit tests for optimization routines from optimize.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from __future__ import division, print_function, absolute_import
import itertools
import numpy as np
from numpy.testing import (... | |
import sys
from functools import partial
import pluginmanager
import plugin
from utilities.GeneralUtilities import warning, error, executable_exists
class PluginManager(object):
"""
Frontend for pluginmanager
https://github.com/benhoff/pluginmanager
Also handles plugin.PluginComposed
"""
de... | |
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for various parts of L{twisted.web}.
"""
from cStringIO import StringIO
from zope.interface import implements
from twisted.trial import unittest
from twisted.internet.address import IPv4Address
from twisted.internet.defer im... | |
from collections import Counter
from unittest.mock import patch, Mock
from django.test import SimpleTestCase, TestCase
from casexml.apps.case.mock import CaseStructure, CaseIndex, CaseFactory
from corehq.apps.domain.shortcuts import create_user
from corehq.apps.registry.exceptions import RegistryAccessException
from ... | |
'''
Created on 2016/9/22
:author: hubo
'''
from vlcp.config import Configurable, config
from vlcp.protocol.zookeeper import ZooKeeper, ZooKeeperRetryException,\
ZooKeeperConnectionStateEvent, ZooKeeperResponseEvent, ZooKeeperWatcherEvent,\
ZooKeeperSessionExpiredException
from random import shuffle, random, r... | |
# Copyright 2014 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 required by a... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.apps import apps
from django.core import checks
from django.core.checks import Error, Warning
from django.core.checks.registry import CheckRegistry
from django.core.management import call_command
from django.core.management.base im... | |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'LogIdenticalProduct.basemodel_ptr'
db.delete_column(u'c... | |
# Copyright (c) 2017 Ansible by Red Hat
# All Rights Reserved.
import pytest
from django.core.exceptions import ValidationError
from awx.main.utils import decrypt_field
from awx.main.models import Credential, CredentialType
from rest_framework import serializers
EXAMPLE_PRIVATE_KEY = '-----BEGIN PRIVATE KEY-----\nx... | |
# Copyright 2015 Red Hat, 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... | |
"""Main test file for the pyrabbit Client."""
import json
try:
#python 2.x
import unittest2 as unittest
except ImportError:
#python 3.x
import unittest
import sys
sys.path.append('..')
import pyrabbit
from mock import Mock, patch
class TestClient(unittest.TestCase):
def setUp(self):
self... | |
# Copyright 2020 Red Hat, 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 o... | |
# Copyright 2015 Intel, 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 agr... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts).
Contents:
- BaseHTTPRequestHandler: HTTP request handler base class
- test: test function
XXX To do:
- send server version
- l... | |
from sqlalchemy.test.testing import assert_raises, assert_raises_message
import sqlalchemy as sa
from sqlalchemy.test import testing
from sqlalchemy.orm import scoped_session
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.test.schema import Table, Column
from sqlalchemy.orm import mapper, relation, ... | |
"""Alexa capabilities."""
import logging
from typing import List, Optional
from homeassistant.components import (
cover,
fan,
image_processing,
input_number,
light,
timer,
vacuum,
)
from homeassistant.components.alarm_control_panel import ATTR_CODE_FORMAT, FORMAT_NUMBER
from homeassistant.c... | |
import collections
import itertools
import numpy as np
import sklearn.cluster
import networkx as nx
import scrapely.htmlpage as hp
import _kernel as _ker
import dtw
def to_rows(d):
"""Make a square matrix with rows equal to 'd'.
>>> print to_rows(np.array([1,2,3,4]))
[[1 2 3 4]
[1 2 3 4]
[1 2... | |
"""Schevo-specific exceptions."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
# ======================================================================
# Runtime errors
class Restricted(RuntimeError):
"""The attempted operation was restricted."""
class BackendConflictError(RuntimeErr... | |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.execute("create index canvas_comment_id_and_visibility_and_parent_comment_id_and_ugq on canvas_comment (id, visib... | |
# Copyright (c) 2014 Alex Meade
# Copyright (c) 2015 Yogesh Kshirsagar
# Copyright (c) 2015 Michael Price
# 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
#
# ... | |
import sys
import os
import traceback
from collections import deque
try:
import simplejson as json
except ImportError:
import json
json_encode = lambda x: json.dumps(x)
json_decode = lambda x: json.loads(x)
#reads lines and reconstructs newlines appropriately
def readMsg():
msg = ""
while True:
... | |
"""Fourier Series"""
from __future__ import print_function, division
from sympy import pi, oo
from sympy.core.expr import Expr
from sympy.core.add import Add
from sympy.core.sympify import sympify
from sympy.core.singleton import S
from sympy.core.symbol import Dummy, Symbol
from sympy.core.compatibility import is_se... | |
#!/usr/bin/env python
# Copyright 2017, 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 o... | |
"""Config flow for Universal Devices ISY994 integration."""
import logging
from urllib.parse import urlparse
from pyisy.configuration import Configuration
from pyisy.connection import Connection
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.components import ss... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
"""Default variable filters."""
from __future__ import unicode_literals
import re
import random as random_module
import unicodedata
from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP
from functools import wraps
from pprint import pformat
from django.template.base import Variable, Library, VariableD... | |
import copy
import numpy as np
from numpy.testing import (
assert_,
assert_equal,
assert_allclose,
assert_array_equal
)
import pytest
from pytest import raises, warns
from scipy.signal._peak_finding import (
argrelmax,
argrelmin,
peak_prominences,
peak_widths,
_unpack_condition_arg... | |
from __future__ import absolute_import, unicode_literals
import warnings
from collections import OrderedDict
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.http import Http404
from rest_framework import status
from rest_framework.renderers import BrowsableAPIRenderer, JSONRe... | |
# -*- 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... | |
## Module histogram.py
##
## Copyright (c) 2014 Antonio Valente <[email protected]>
##
## 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
#... | |
#Code by Chris Tralie, Parit Burintrathikul, Justin Wang, Lydia Xu, Billy Wan, and Jay Wang
import sys
import numpy as np
from scipy import sparse
import scipy.io as sio
from scipy.linalg import norm
from scipy.sparse.linalg import lsqr
def saveOffFileExternal(filename, VPos, VColors, ITris):
#Save off file given ... | |
# 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 u... | |
"""Copyright 2009 Chris Davis
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
dist... | |
# 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... | |
""" Tests for Processors """
import pandas as pd
from pandas.testing import (
assert_frame_equal, assert_series_equal, assert_index_equal
)
from ftpvl.processors import *
from ftpvl.evaluation import Evaluation
class TestProcessor:
"""
Testing by partition.
MinusOne()
StandardizeTypes()
Cl... | |
#!/usr/bin/env python
'''
Ansible module for zabbix items
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix item ansible module
#
#
# Copyright 2015 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 m... | |
from __builtin__ import enumerate
import matplotlib
from kid_readout.roach import baseband
matplotlib.use('agg')
import numpy as np
import time
import sys
from kid_readout.utils import data_file,sweeps
from kid_readout.analysis.resonator import fit_best_resonator
mmw_source_frequency = np.nan
source_on_freq_scale ... | |
"""
Unittests for iterative_repair module.
"""
import json
import unittest
import networkx as nx
from networkx.readwrite import json_graph
from stitcher import iterative_repair
def _sample_data():
cont = nx.DiGraph()
cont.add_node('1', **{'type': 'a', 'group': 'foo', 'rank': 1.0})
cont.add_node('2', *... | |
from __future__ import absolute_import
from __future__ import print_function
import ujson
from django.http import HttpResponse
from mock import patch
from typing import Any, Dict, List, Text, Union
from zerver.lib.actions import (
do_change_is_admin,
do_set_realm_property,
do_deactivate_realm,
)
from ze... | |
"""
Test suite for socketserver.
"""
import contextlib
import imp
import os
import select
import signal
import socket
import select
import errno
import tempfile
import unittest
import socketserver
import test.support
from test.support import reap_children, reap_threads, verbose
try:
import threading
except Import... | |
import StringIO
import json
import logging
import random
import urllib
import urllib2
import os
# from urllib.parse import urlparse
from time import gmtime, strftime
from datetime import datetime
from firebase import firebase
# for sending images
# from PIL import Image
# import multipart
# standard app engine impor... | |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string, optparse, subprocess
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','desc... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:29376")
else:
access = Se... | |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | |
import collections
import csv
import random
from operator import itemgetter
from optparse import make_option
from os.path import basename, splitext
from django.core.management.base import BaseCommand, CommandError
from django.core.validators import URLValidator, ValidationError
from django.db.transaction import atomic... | |
# 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... | |
"""
Satchmo shipping module using python-fedex
"""
# Note, make sure you use decimal math everywhere!
from decimal import Decimal
from django.utils.translation import ugettext as _
from shipping.modules.base import BaseShipper
from fedex.base_service import FedexBaseServiceException
from fedex.services.rate_service i... | |
# Copyright 2013 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 agree... | |
# -*- coding: utf8 -*-
import rlp
from bitcoin import encode_pubkey, N, encode_privkey
from rlp.sedes import big_endian_int, binary
from rlp.utils import encode_hex, str_to_bytes, ascii_chr
from secp256k1 import PublicKey, ALL_FLAGS, PrivateKey
from ethereum.exceptions import InvalidTransaction
from ethereum import bl... | |
import os
import sys
import string
import argparse
from build.sdk_build_utils import *
WINPHONE10_ARCHS = ['x86', 'x64', 'ARM64']
DEFAULT_MSBUILD = "C:/Program Files (x86)/MSBuild/14.0/Bin/msbuild.exe"
def msbuild(args, dir, *cmdArgs):
return execute(args.msbuild, dir, *cmdArgs)
def nuget(args, dir, *cmdArgs):
... | |
import unittest
import os
import yaml
from medleydb import multitrack
from medleydb import AUDIO_PATH
from medleydb import MIXING_COEFFICIENTS
class TestMultitrack(unittest.TestCase):
def setUp(self):
self.mtrack = multitrack.MultiTrack("NightPanther_Fire")
self.mtrack2 = multitrack.MultiTrack("Ph... | |
from django.contrib.auth.views import redirect_to_login
from django.db.models.aggregates import Max
from django.http.response import HttpResponse, HttpResponseBadRequest, \
HttpResponseForbidden
from django.shortcuts import get_object_or_404, render, redirect
from django.template import RequestContext
from django.t... | |
import random
import string
from django.core.mail import EmailMessage
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from core.models import Event, User
from .utils im... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .address import (
key_to_p2sh_p2wpkh,
... | |
#!/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 -*-
"""
molvs.charge
~~~~~~~~~~~~
This module implements tools for manipulating charges on molecules. In particular, :class:`~molvs.charge.Reionizer`,
which competitively reionizes acids such that the strongest acids ionize first, and :class:`~molvs.charge.Uncharger`,
which attempts to neutralize i... | |
###
# Copyright (c) 2003-2005, Jeremiah Fincher
# Copyright (c) 2008-2009, James McCoy
# 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 ... | |
#!/usr/bin/env python3
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test replace-by-fee
#
import os
import sys
# Add python-bitcoinlib to module search path, prior to any s... | |
# coding=utf-8
# Copyright 2021 The Circuit Training Team 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 ap... | |
import sys
def _print(*args):
for arg in args:
sys.stdout.write('%s '%arg)
sys.stdout.write('\n')
if sys.version.startswith('3.0'):
PY_VER = '3.x'
from urllib.parse import quote_plus,parse_qsl
from urllib.request import urlopen,urlretrieve
from hashlib import sha1
new_sha = lambda ... | |
# 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 ... | |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string, optparse, subprocess
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['name','version','moduleid','desc... | |
# -*- coding: utf-8 -*-
"""
wakatime.languages.templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Parse dependencies from Templates.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
from . import TokenParser
from ..compat import u
""" If these keywords are found in the so... | |
# TODO merge this with normal nnet
import gnumpy as gp
import numpy as np
import ctc_fast as ctc
#import ctc
# debug tool
#from IPython import embed
#from ipsh import *
#DEBUG = TRUE
def relu_hard(x, computeGrad = False):
if (not computeGrad):
f = (1/2.)*(x+gp.sign(x)*x)
return f
g = np.sign(... | |
"""Ansible integration test infrastructure."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import contextlib
import json
import os
import shutil
import tempfile
from .. import types as t
from ..target import (
analyze_integration_target_dependencies,
walk_integrati... | |
import re
import numpy as np
import math
import os
from skbeam.core.fitting.xrf_model import K_LINE, L_LINE, M_LINE
from skbeam.core.constants.xrf import XrfElement
from skbeam.core.fitting.lineshapes import gaussian
from ..model.load_data_from_db import save_data_to_hdf5
from ..core.quant_analysis import ParamQuantE... | |
# 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... | |
# 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 u... | |
# Copyright 2014 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 required by applicable ... | |
"""Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | |
#!/usr/bin/env python3
#
# This script bootstraps an NSQ cluster in EC2 and runs benchmarks.
#
# Requires python3 and the following packages:
# - boto3
# - paramiko
# - tornado
#
# AWS authentication is delegated entirely to the boto3 environment, see:
#
# https://boto3.amazonaws.com/v1/documentation/api/latest/... | |
# 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 (t... | |
# Natural Language Toolkit: Combinatory Categorial Grammar
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Graeme Gange <[email protected]>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
The lexicon is constructed by calling
``lexicon.fromstring(<lexicon string>)``.
In order to c... | |
import pygatt
import time
import json
import redis
import uuid
import requests
import pexpect
import api
from discovery import discover
from multiprocessing import Process, Queue
r = redis.StrictRedis(host="localhost", port=6379, db=0)
def start():
workers = {}
devices = discover(2)
for mac_address in dev... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# palette.py
# palette_detect
#
"""
Detect the main colors used in an image.
"""
import colorsys
import matplotlib.colors as colors
import multiprocessing
import sys
from PIL import Image, ImageChops, ImageDraw
from collections import Counter, namedtuple
from colormath... | |
# 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 u... | |
# -*- coding: utf-8 -*-
"""
Created on Feb 20, 2014
@author: Aaron Ponti
"""
import re
from ch.systemsx.cisd.openbis.dss.etl.dto.api import SimpleImageDataConfig
from ch.systemsx.cisd.openbis.dss.etl.dto.api import SimpleImageContainerDataConfig
from ch.systemsx.cisd.openbis.dss.etl.dto.api.impl import MaximumIntens... | |
from lxml import etree
from bioagents import add_agent_type, infer_agent_type
from indra.sources.trips import process_xml
from kqml import KQMLList
from indra.statements import RefContext, BioContext, Agent
class EKB(object):
def __init__(self, graph, term_node):
self.graph = graph
self.graph.dra... | |
# 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 u... | |
__author__ = 'Christoph Jansen, HTW Berlin'
import theano
import theano.tensor as T
from theano import dot
from theano.tensor.nnet import sigmoid as sigm
from theano.tensor import tanh
from theano.tensor.nnet import softmax
from theano.tensor.nnet import categorical_crossentropy
import os
import numpy as np
from datet... | |
# 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... | |
"""Undocumented Module"""
__all__ = ['DirectRadioButton']
from pandac.PandaModules import *
import DirectGuiGlobals as DGG
from DirectButton import *
from DirectLabel import *
class DirectRadioButton(DirectButton):
"""
DirectRadioButton(parent) - Create a DirectGuiWidget which responds
to mouse clicks by... | |
# 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 u... | |
import unittest
from troposphere import (
MAX_MAPPINGS,
MAX_OUTPUTS,
MAX_PARAMETERS,
MAX_RESOURCES,
Output,
Parameter,
Template,
)
from troposphere.s3 import Bucket
from troposphere.serverless import Globals
class TestInitArguments(unittest.TestCase):
def test_description_default(self... | |
"""Document fields."""
import abc
import re
from datetime import datetime
from decimal import Decimal
import bson.errors
from bson import ObjectId, Decimal128
from aiomongodel.errors import ValidationError, StopValidation
from aiomongodel.utils import _Empty, import_class
__all__ = ['AnyField', 'StrField', 'EmailF... | |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Pelix interactive shell
Provides a console interface for the Pelix shell, based on readline when
available.
:author: Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Thomas Calmant
... | |
import collections
import struct
from ..util import (slicebyn, boolean_bitarray_tuple, lazy_property,
CachedSequence)
from ..exceptions import MalformedDataError, NotRecordedError
class SongData(CachedSequence):
"""
Container for all the useful data in a song section of a bulk dump.
E... | |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.geometry.primitives import Primitive
from compas.geometry.primitives import Point
class Line(Primitive):
"""A line is defined by two points.
Parameters
----------
p1 : [float, flo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.