gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
#
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | |
#!/usr/bin/env python3
# Copyright (c) 2016 The Stardust Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the SegWit changeover logic
#
from test_framework.test_framework import StardustTestFramework
from ... | |
import bs
import bsUtils
import bsElimination
import bsBomb
import bsSpaz
import random
import math
class Map:
center = (0, 3, -4)
radius = 8
@classmethod
def inBounds(cls, pos):
dx, dy, dz = pos[0] - cls.center[0], pos[1] - cls.center[1], pos[2] - cls.center[2],
return cls.radius >= math.sqrt(dx**2 + dy**2 ... | |
# 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... | |
import sys
import json
import uuid
import logging
from testtools.matchers import Equals, Contains, Not
from testtools import content, content_type, ExpectedException
import webtest.app
from vnc_api.vnc_api import *
sys.path.append('../common/tests')
from test_utils import *
import test_common
import test_case
logg... | |
"""Support to interact with a Music Player Daemon."""
from contextlib import suppress
from datetime import timedelta
import hashlib
import logging
import os
import mpd
from mpd.asyncio import MPDClient
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from h... | |
# Command line arguments:
# - path to directory containing previously generated .csv files
# - path to new OTT (not ending in /)
# - versioned name of new OTT e.g. ott3.1
# - path to OTT properties.json file
# - path to output directory (will hold ott*.csv and by_qid.csv)
import sys, os, csv, json, argparse
def ... | |
#!/usr/bin/env python
"""
General Utilities
(part of web.py)
"""
__all__ = [
"Storage", "storage", "storify",
"Counter", "counter",
"iters",
"rstrips", "lstrips", "strips",
"safeunicode", "safestr", "utf8",
"TimeoutError", "timelimit",
"Memoize", "memoize",
"re_compile", "re_subm",
"group", "uniq"... | |
# file openpyxl/reader/style.py
# Copyright (c) 2010-2011 openpyxl
#
# 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, co... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
libG(oogle)Reader
Copyright (C) 2010 Matt Behrens <askedrelic@gmail.com> http://asktherelic.com
Python library for working with the unofficial Google Reader API.
Unit tests for oauth and ClientAuthMethod in libgreader.
"""
try:
import unittest2 as unittest
exc... | |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.test_SimulationInputs
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Test the module `SimulationInputs`.
"""
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__co... | |
import numpy as np
def sample_features_PoissonProp(F_prev,gamma0,data_struct,dist_struct,theta,obsModel,hyperparams,Kstar):
# function [F dist_struct theta config_log_likelihood num_prop num_accept] =
# sample_features_PoissonProp(F_prev,gamma0,data_struct,dist_struct,theta,obsModel,...
# hyperparams,Kstar)
... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import shutil
import tempfile
import os
from stalker import (db, Version, Task, Project, Structure, StatusList,
... | |
# Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
import os
import re
import math
import hashlib
import logging
import warnings
import errno
from time import sleep
from collections import defaultdict
from ..core.json import... | |
import math
import sys
import numpy
from numpy.testing import (assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
import pytest
from pytest import raises as assert_raises
import scipy.ndimage as ndimage
from . import types
eps = 1e-12
class TestNdima... | |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | |
"""The Shelly integration."""
import asyncio
from datetime import timedelta
import logging
import aioshelly
import async_timeout
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_DEVICE_ID,
CONF_HOST,
CONF_PASSWORD,
CONF_USERNAME,
... | |
# 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... | |
import re
from rdopkg.actionmods import rdoinfo
from rdopkg.actionmods import query
from rdopkg.actionmods import pymod2pkg
from rdopkg import exception
from rdopkg.utils.cmd import git
from rdopkg.utils import log
from rdopkg.utils import specfile
from rdopkg import helpers
class DiffReq(object):
def __init__(... | |
#!/usr/bin/python3
#
# Copyright 2015 MarkLogic Corporation
#
# This script lists all of the artifacts on the server or, if the name (and
# optionally a type) of an artifact is given, displays the properties of
# that artifact.
#
# For example:
#
# python3 properties.py
#
# or
#
# python3 properties.py App-Services
#
#... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated by generateDS.py.
#
import sys
import getopt
import re as re_
import base64
import datetime as datetime_
etree_ = None
Verbose_import_ = False
(
XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_impor... | |
# This file is part of COFFEE
#
# COFFEE is Copyright (c) 2014, Imperial College London.
# Please see the AUTHORS file in the main source directory for
# a full list of copyright holders. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | |
#!/usr/bin/env python
#/******************************************************************************
# * $Id: ogrinfo.py 23329 2011-11-05 21:09:07Z rouault $
# *
# * Project: OpenGIS Simple Features Reference Implementation
# * Purpose: Python port of a simple client for viewing OGR driver data.
# * Author: Even ... | |
'''
Provides both a trailing spaces highlighter and a deletion command.
See README.md for details.
@author: Jean-Denis Vauguet <jd@vauguet.fr>, Oktay Acikalin <ok@ryotic.de>
@license: MIT (http://www.opensource.org/licenses/mit-license.php)
@since: 2011-02-25
'''
import sublime
import sublime_plugin
import difflib
i... | |
import decimal
import warnings
import functools
import contextlib
from decimal import Decimal
from datetime import datetime, timedelta
import pytest
from hypothesis import assume, example, given, target
from hypothesis.extra.numpy import array_shapes, arrays
from hypothesis.strategies import (composite, datetimes, flo... | |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | |
from prefixcommons import curie_util
from prefixcommons.curie_util import contract_uri, expand_uri, get_prefixes
from ontobio.vocabulary.relations import OboRO, Evidence
from ontobio.vocabulary.upper import UpperLevel
from ontobio.ecomap import EcoMap
from ontobio.rdfgen import relations
from ontobio.model import assoc... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import calendar
from flask import Flask, jsonify, render_template, request, abort, redirect, url_for, make_response
from flask.json import JSONEncoder
from datetime import datetime
import time
import json
import threading
import random
import string
import os
f... | |
# Copyright (c) 2018 PaddlePaddle 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 app... | |
import tempfile
import shutil
import os
import numpy as np
from numpy import pi
from numpy.testing import (assert_array_almost_equal,
assert_equal, assert_warns)
import pytest
from pytest import raises as assert_raises
from scipy.odr import (Data, Model, ODR, RealData, OdrStop, OdrWarning,
... | |
from __future__ import absolute_import
import urwid
from . import common
def _mkhelp():
text = []
keys = [
("A", "accept all intercepted flows"),
("a", "accept this intercepted flow"),
("C", "clear flow list or eventlog"),
("d", "delete flow"),
("D", "duplicate flow"),
... | |
# No shebang line. This module is meant to be imported.
#
# Copyright 2010. Luis Artola. All rights reserved.
#
#
# $URL: file:///svn/restblog/trunk/src/python/restblog/post.py $
# $Date: 2010-07-31 14:27:54 -0700 (Sat, 31 Jul 2010) $
# $Revision: 186 $
#
# History:
# 2010.06.30 lartola Initial working version
#
... | |
# 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... | |
from rest_framework import serializers
from dcim import models
from netbox.api import WritableNestedSerializer
__all__ = [
'NestedCableSerializer',
'NestedConsolePortSerializer',
'NestedConsolePortTemplateSerializer',
'NestedConsoleServerPortSerializer',
'NestedConsoleServerPortTemplateSerializer'... | |
# -*- coding: utf-8 -*-
from django.forms.models import model_to_dict
from django.test.utils import override_settings
from cms.api import add_plugin
from cms.models import CMSPlugin, Placeholder, UserSettings
from cms.test_utils.project.placeholderapp.exceptions import PlaceholderHookException
from cms.test_utils.proj... | |
# coding: spec
from tests.helpers import HarpoonCase
from harpoon.executor import docker_context as docker_context_maker
from delfick_project.errors_pytest import assertRaises
from docker.errors import ImageNotFound, NotFound
from contextlib import contextmanager
from textwrap import dedent
import subprocess
import ... | |
from flask import Flask, jsonify, redirect
import sqlalchemy
from db import init_db_engine
import json
from collections import OrderedDict
connect_str = "postgres://codeai:codeai@localhost:5432/codeai"
global engine
engine = init_db_engine(connect_str)
MY_API = '/api/1.0/'
app = Flask(__name__)
@app.route(MY_API + ... | |
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla and SciTE source files that list
# all the lexers and all the properties files.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.4 or later
# Most files are regene... | |
#!/usr/bin/env python
import os
import datetime
import numpy as np
import optparse
from collections import OrderedDict
from utils import create_input_batch
import loader
from utils import models_path, models_saver_path, evaluate
from loader import word_mapping, char_mapping, tag_mapping
from loader import prepare_dat... | |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import numpy as np
import numbers
from joblib import Parallel, effective_n_job... | |
# 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... | |
"""
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft 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/LICEN... | |
# 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 t... | |
#!/usr/bin/env python
"""
instaRaider.py
This function contains code that is originally Copyright (c) {{{2014}}} {{{Amir Kurtovic}}}
"""
from bs4 import BeautifulSoup
import selenium.webdriver as webdriver
import re
from time import sleep
import urllib
import urllib2
import os
import sys
import argparse
import pdb
impo... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | |
import json
import pytest
from oic.utils.http_util import Response, NoContent, Unauthorized
from oic.utils.authn.authn_context import AuthnBroker
from oic.utils.authn.client import verify_client
from oic.utils.authn.client import BearerHeader
from oic.utils.authn.client import ClientSecretPost
from oic.utils.authn.cl... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# Meta-info
Author: Nelson Brochado
Created: 01/06/2015
Updated: 02/04/2018
# Description
## What's a hash map (or hash table)?
A hash map is a data structure which is used to implement the so-called
associative array, which is an abstract data type composed of ... | |
# 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
# d... | |
import os, sys, imp
import logging.config
import datetime, time
from collections import OrderedDict
#Application Diretory
__app_dir__ = 'app'
class ApplicationBase:
'''Base Application'''
class Application(ApplicationBase):
def __init__(self, app_path):
self.initialized = False
self.app_path = app_path
... | |
from __future__ import with_statement
import pytest
import aredis
from aredis.exceptions import ConnectionError, TimeoutError
from aredis.sentinel import (Sentinel, SentinelConnectionPool,
MasterNotFoundError, SlaveNotFoundError)
class SentinelTestClient:
def __init__(self, cluster, ... | |
from __future__ import print_function,absolute_import,division
_AD='expected the empty value, but found %r'
_AC='cannot find module %r (%s)'
_AB='expected non-empty name appended to the tag'
_AA='tag:yaml.org,2002:map'
_A9='tag:yaml.org,2002:seq'
_A8='tag:yaml.org,2002:set'
_A7='tag:yaml.org,2002:pairs'
_A6='tag:yaml.o... | |
from flask import Flask, redirect, render_template, session, url_for, flash, request, send_file
from flask.ext.wtf import Form
from flask.ext.sqlalchemy import SQLAlchemy
from wtforms import StringField, SubmitField
from wtforms.validators import Required
from flask.ext.bootstrap import Bootstrap
from flask.ext.mai... | |
# Copyright 2017-2018 Tom Eulenfeld, GPLv3
"""Commands used by the CLI interface"""
import functools
import glob
import logging
import multiprocessing
import os
import re
import shutil
import textwrap
import h5py
import numpy as np
import obspy
from obspy.core import UTCDateTime as UTC
import obspyh5
import tqdm
impo... | |
""" TensorFlow Layers
Convenience functions but Input and Output should be tensors.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib import seq2seq
_phase = tf.Variable(False, name='phase', trainable=Fals... | |
#!/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... | |
# 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 applicable ... | |
import pymongo
import threading
import core
logger = core.log.getLogger("db-manager")
class DBManager(object):
"""This object is a wrapper for MongoClient to communicate to the RO
(local) mongo-db"""
def __init__(self):
self.__mutex = threading.Lock()
# (felix_ro) RoutingTable
def get_c... | |
# encoding: utf-8
import mock
from nose.tools import * # noqa
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
from website.addons.osfstorage.tests import factories
from website.addons.osfstorage.tests.utils import StorageTestCase
import datetime
from modularodm import exceptions as m... | |
# -*- 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
from os.path import abspath, dirname
class Migration(SchemaMigration):
def forwards(self, orm):
sql_migration_file = "{}/migration_0072_up.s... | |
"""
Loads the energy data csv files acquired through the loader scripts
(ion_get_data.py or jci_get_data.py), and inserts them into the Postgres
energy database.
"""
import csv
import os
import pyodbc
import sys
import util
DB = util.PG_DB
USER = util.PG_USER
PWD = uti.PG_PWD
# Default data directory if none is supp... | |
################################################################################
# Copyright (C) 2011-2013 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
General numerical functions and methods.
"""
import functool... | |
# 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... | |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | |
# coding=utf-8
# Copyright 2015 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 logging
impor... | |
"""Denon HEOS Media Player."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from pyheos import Heos, HeosError, const as heos_const
import voluptuous as vol
from homeassistant.components.media_player.const import DOMAIN as MEDIA_PLAYER_DOMAIN
from homeassistant.conf... | |
# Library for full image cnn operations
import numpy as np
import pycuda.autoinit
import pycuda.driver as cu
import pycuda.compiler as nvcc
import pycuda.gpuarray as gpuarray
VALID_SIZE_CROP = False
def _centered(arr, newsize):
# Return the center newsize portion of the array.
newsize = asarray(newsize)
... | |
import numpy as np
from scipy import stats
import scipy.io
from matplotlib import pyplot as plt
import pstats
# Message Passing on Single Node
# G: non-symmetric social networks
# Y: evidence, observed data
# T: num. of iterations
# X: used for test
def AEMBP_GCHMM(G,Y,C, sC, initial, MaxIter, tol,X, prior={'xi': 0.2... | |
# 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... | |
#
# 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
# ... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.boot import get_allowed_pages
@frappe.whitelist()
def get(module):
"""Returns data (sections, list of reports, counts) to render m... | |
# stdlib
from contextlib import contextmanager
from random import random, randrange
import os
import subprocess
import sys
import time
import unittest
import urllib as url
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
# needed because of the subprocess calls
sys.path.append(os.getcwd())
f... | |
import os
import unittest
import datetime
from provstore.api import Api, NotFoundException, InvalidCredentialsException, InvalidDataException, ForbiddenException
from provstore.document import AbstractDocumentException, ImmutableDocumentException, EmptyDocumentException
import provstore.tests.examples as examples
PR... | |
import os
from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq,
express, variation, gtf, stringtie)
from bcbio.ngsalign import bwa, bowtie2, alignprep
import bcbio.pipeline.datadict as dd
from bcbio.utils import filter_missing
from bcbio.log import logger
def rnaseq_var... | |
import os
import wx
import wx.lib.newevent
from sas.sascalc.dataloader.readers.cansas_reader import Reader
from sas.sasgui.guiframe.utils import format_number
from sas.sasgui.guiframe.events import EVT_SLICER_PARS, EVT_SLICER
from sas.sasgui.guiframe.events import SlicerParameterEvent, StatusEvent
from Plotter2D impo... | |
"""
QUTest Testing Module version 1.0
(c) James Wu 2013
QUTest is a simple unit testing framework for python.
See readme for details.
"""
import time, numpy, math, gc, string, random
from scipy.stats import linregress
import itertools
from inspect import getargspec
#used for when the output is unknown
class Unknown... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# zernike.py
"""
A module defining the zernike polynomials and associated functions.
Running this file as a script will output a graph of the first 15 zernike
polynomials on the unit disk.
https://en.wikipedia.org/wiki/Zernike_polynomials
http://mathworld.wolfram.com/Zern... | |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.checks import Error
from django.db import models
from django.test.utils import override_settings
from django.test.testcases import skipIfDBFeature
from .base import IsolatedModelsTestCase
class RelativeFieldTests(IsolatedModelsTestCa... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import xml.etree.ElementTree as ET
import io
try:
register_namespace = ET.register_namespace
except AttributeError:
def register_namespace(prefix, uri):
ET._namespace_map[uri] = prefix
import requests
# TODO: test escaping
class MPNSBa... | |
#
# 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 sqlagg.columns import *
from corehq.apps.reports.sqlreport import SqlTabularReport, DatabaseColumn
from corehq.apps.reports.filters.fixtures import AsyncDrillableFilter
from corehq.apps.reports.filters.select import GroupFilter
from corehq.apps.reports.dont_use.fields import BooleanField
from corehq.apps.reports.s... | |
import requests
import json
import datetime
import time
from tabulate import tabulate
from colorama import init
init(autoreset=True)
__author__ = 'asifj'
class Utils:
def __init__(self):
self.url = "http://172.22.147.248:8092/api/"
pass
def header(self, document, document_no, case_key):
... | |
from struct import pack, unpack
import hashlib
import sys
import traceback
from electrum import bitcoin
from electrum.bitcoin import TYPE_ADDRESS, int_to_hex, var_int
from electrum.i18n import _
from electrum.plugin import BasePlugin
from electrum.keystore import Hardware_KeyStore
from electrum.transaction import Tran... | |
# -*- coding: utf-8 -*-
"""
This module implements a Python-to-SQLAlchemy syntax parser.
Allows the SQLAlchemy data-layer to seamlessy respond to a
Python-like query.
:copyright: (c) 2013 by Andrew Mleczko and Tomasz Jezierski (Tefnet)
:license: BSD, see LICENSE for more details.
"""
import re
imp... | |
import os
from Queue import Queue
try:
import simplejson as json
except ImportError:
import json
import logging
import subprocess
from octopus.core.communication.http import Http400, Http404
from octopus.worker import settings
from octopus.worker.worker import WorkerInternalException
from tornado.web import ... | |
"""
Functionality for scaling agent attributes or the number of agents to
match targets.
"""
from __future__ import division, print_function
from collections import namedtuple
from numbers import Number
import numpy as np
import pandas as pd
from .targets import apply_filter_query
def _scale_col_to_target(col, ta... | |
""" report test results in JUnit-XML format, for use with Hudson and build integration servers.
Based on initial code from Ross Lawley.
"""
import py
import os
import re
import sys
import time
# Python 2.X and 3.X compatibility
try:
unichr(65)
except NameError:
unichr = chr
try:
unicode('A')
except Name... | |
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# 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, co... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
def bi(name, shape, value=0.0, dtype=tf.float32):
"""Declares a bias variable with constant initialization."""
return tf.get_variable(
name=name,
shape=shape,
dtype=dtype,
initializer=tf.co... | |
#!/usr/bin/python
import scipy
import scipy.interpolate
import scipy.signal
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import math
from ..model import DAGModel
from .. import utils
def _floor(v, n):
return int(n * math.floor(v/n))
def _find_nearest_index(array, value):
value = (3... | |
"""
============================
Base RPC Handler for Tornado
============================
This is a basic server implementation, designed for use within the
Tornado framework. The classes in this library should not be used
directly, but rather though the XML or JSON RPC implementations.
You can use the utility functio... | |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | |
import sys, os, time
import numpy as np
from subprocess import Popen, list2cmdline, PIPE
from shutil import copy2
# def cpu_count():
# ''' Returns the number of CPUs in the system
# '''
# num = 1
# try:
# num = os.sysconf('SC_NPROCESSORS_ONLN')
# except (ValueError, OSError, AttributeError)... | |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | |
size(800,2600)
def header():
font("Verdana", 12)
text("NodeBox Compliance Tests", 20, 60)
stroke(0)
line(0,60,WIDTH,60)
fontsize(8.5)
nostroke()
text("This functional suite tests all the available NodeBox functions, to see if they comply to their contract." , 20, 80, width=200)
def pri... | |
##############################################################################
# DrugBank v4.3 XML parser
#
# eg 15/01/2016
##############################################################################
from xml.etree.ElementTree import iterparse
import os, cPickle
import re, math
def main():
base_dir = "../data/... | |
#
# 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
# ... | |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | |
#!/usr/bin/envn python3
# -+-coding: utf-8 -+-
#----------------------------------------
# Created by fboers at 19.09.18
#----------------------------------------
# Update
#----------------------------------------
import wx
from pubsub import pub
from jumeg.gui.wxlib.jumeg_gui_wxlib_logger import JuMEG_w... | |
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.