gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import copy
from flask import current_app as app, abort
from eve.utils import config, debug_error_message
from werkzeug.exceptions import BadRequestKeyError
def versioned_id_field():
""" Shorthand to add two commonly added versioning parameters.
.. versionadded: 0.4
"""
return app.config['ID_FIELD'] ... | |
# 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 re
def CreateLowOverheadFilter():
"""Returns a filter with the least overhead possible.
This contains no sub-traces of thread tasks, so it's on... | |
# Copyright 2013-2014 MongoDB, 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 writin... | |
"""Single slice vgg with normalised scale.
"""
import functools
import lasagne as nn
import numpy as np
import theano
import theano.tensor as T
import data_loader
import deep_learning_layers
import image_transform
import layers
import preprocess
import postprocess
import objectives
import theano_printer
import update... | |
import logging
import pickle
import nose
import gc
import tempfile
import os
import ana
import claripy
import angr
from angr import SimState
binaries_base = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries')
def test_state():
s = SimState(arch='AMD64')
s.registers.store('sp',... | |
# -*- coding: utf-8 -*-
"""
gspread.utils
~~~~~~~~~~~~~
This module contains utility functions.
"""
import sys
import re
from functools import wraps
from collections import defaultdict
from itertools import chain
from .exceptions import IncorrectCellLabel, NoValidUrlKeyFound
if sys.version_info.major == 2:
i... | |
#! /usr/bin/env python
#Todo
#Better outlier removal
#Check Nuth and Kaab bin median
#Implement check for empty diff
import sys
import os
import argparse
import subprocess
from osgeo import gdal
import numpy as np
import matplotlib.pyplot as plt
from pygeotools.lib import iolib, malib, geolib, warplib, filtlib
fro... | |
# -*- coding: utf-8 -*-
import argparse
import contextlib
import gzip
import os
import sys
import math
import random
from os.path import join
from functools import reduce
import logging
from gensim.models import Word2Vec
import numpy as np
sys.path.append('.')
from discoutils.misc import mkdirs_if_not_exists, is_gzi... | |
# Copyright 2020 DeepMind Technologies Limited. 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... | |
"""
FlexGet build and development utilities - unfortunately this file is somewhat messy
"""
from __future__ import print_function
import os
import sys
from paver.easy import *
import paver.virtual
import paver.setuputils
from paver.setuputils import setup, find_package_data, find_packages
sphinxcontrib = False
try:
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
module for web framework
'''
import cgi
import datetime
import functools
import json
import logging
import mimetypes
import os
import re
import sys
import threading
import traceback
import types
import urllib
try:
from cStringIO import StringIO
except ImportError... | |
# Copyright 2015 Google Inc. All Rights Reserved.
"""Starts the vtcombo process."""
import json
import logging
import os
import socket
import subprocess
import time
import urllib
from google.protobuf import text_format
from vttest import environment
class VtProcess(object):
"""Base class for a vt process, vtcom... | |
# swift_build_support/products/product.py -----------------------*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... | |
# -*- coding: utf-8 -*-
"""
wakatime.main
~~~~~~~~~~~~~
wakatime module entry point.
:copyright: (c) 2013 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import base64
import logging
import os
import platform
import re
import sys
import time
i... | |
# -*- coding: utf-8 -*-
"""The :program:`celery` umbrella command.
.. program:: celery
.. _preload-options:
Preload Options
---------------
These options are supported by all commands,
and usually parsed before command-specific arguments.
.. cmdoption:: -A, --app
app instance to use (e.g., ``module.attr_name`... | |
# 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 ... | |
from django.shortcuts import render, redirect, get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic import ListView
from django.utils.crypto import get_random_string
from django.core.serializers.json import DjangoJSONEncoder
from proteil.models impo... | |
"""
ANSI - Gives colour to text.
Use the codes defined in ANSIPARSER in your text
to apply colour to text according to the ANSI standard.
Examples:
This is %crRed text%cn and this is normal again.
This is {rRed text{n and this is normal again.
Mostly you should not need to call parse_ansi() explicitly;
it is run b... | |
# -*- 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
#... | |
"""HDXObject abstract class containing helper functions for creating, checking, and updating HDX objects.
New HDX objects should extend this in similar fashion to Resource for example.
"""
import copy
import logging
from abc import ABC, abstractmethod
from collections import UserDict
from typing import Any, Dict, List,... | |
# 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... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 14 08:53:04 2017
@author: e84605
"""
def bar_chart_line(value, maximum, rounding='middle', num_chars=30, value_char='#',
empty_char='_', name=None, name_width=None, name_align='right',
order=['bar', 'proportion', 'absolute'], proport... | |
from ..Qt import QtGui, QtCore
from ..Point import Point
from .GraphicsObject import GraphicsObject
from .. import functions as fn
import numpy as np
import weakref
__all__ = ['InfiniteLine']
class InfiniteLine(GraphicsObject):
"""
**Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
Display... | |
"""
A simple VTK widget for PyQt v5, the Qt v5 bindings for Python.
See http://www.trolltech.com for Qt documentation, and
http://www.riverbankcomputing.co.uk for PyQt.
This class is based on the vtkGenericRenderWindowInteractor and is
therefore fairly powerful. It should also play nicely with the
vtk3DWidget code.
... | |
import datetime
from django.db import models
from kanboard import signals
class Card(models.Model):
"""
A card is a specific piece of work which must be done on a project, which
can be hung on a "board" (under a specific "phase").
"""
title = models.CharField(max_length=80)
board = models.For... | |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program 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 Lic... | |
# issue/views_admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .controllers import *
from .models import ALPHABETICAL_ASCENDING, Issue, OrganizationLinkToIssue
from follow.models import FollowIssue
from admin_tools.views import redirect_to_sign_in_page
from config.base import get_environment... | |
# Copyright 2012 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.
"""Presubmit script for Chromium WebUI resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the pre... | |
# Copyright (c) 2012 OpenStack Foundation.
# Copyright (c) 2014 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... | |
"""
A variety of distribution optimizers using scipy.optimize's methods.
"""
from __future__ import division
from collections import namedtuple
from itertools import combinations
from debtcollector import removals
import numpy as np
from .maxentropy import marginal_constraints_generic
from .optimization import Bas... | |
#
# DEPRECATED: implementation for ffi.verify()
#
import sys, imp
from . import model
from .error import VerificationError
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._... | |
# 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 os
import json
import time
import uuid
import signal
import logging
from threading import Thread
from addict import Dict
from six.moves.http_client import HTTPConnection
from .process import Process
from .interface import ExecutorDriver
from .utils import DAY, parse_duration, encode_data, decode_data
logger = l... | |
# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Administration module forms
"""
from django.db import models
from django import forms
from django.forms import ModelChoiceField
from treeio.core.conf import settings
from django.db.models import Q
from d... | |
#!/usr/bin/env python
# Copyright 2018 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.
"""
If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of
date:
* Downloads the hermetic mac toolchain
... | |
#!/usr/bin/env python
#coding: utf-8
#file : server_modules.py
#author : ning
#date : 2014-02-24 13:00:28
import os
import sys
from utils import *
import conf
class Base:
'''
Sub class should implement:
_alive, _pre_deploy, status, and init self.args
'''
def __init__(self, name, host, port, p... | |
#!/usr/bin/python
#
# An autodetection utility for the Blackberry NDK
#
# WARNING: the paths to qde, project and project name must not contain any
# spaces for the tools to work correctly
import os, sys, platform, subprocess, pprint, shutil, tempfile, telnetlib, time
from optparse import OptionParser
class D... | |
import copy
import json
import logging
import os
import pprint
import subprocess
import tempfile, shutil
import time
from bson.objectid import ObjectId
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_respons... | |
# B's Battle Ship - this version creates player board and randomly generates fleet for the enemy.
######################### SET UP #################################
# import appropriate modules, initialize program,
# and set initial values for parameters
import pygame
from pygame.locals import *
import random
impor... | |
"""
The ``modelchain`` module contains functions and classes that combine
many of the PV power modeling steps. These tools make it easy to
get started with pvlib and demonstrate standard ways to use the
library. With great power comes great responsibility: users should take
the time to read the source code for the modu... | |
import numpy as np
import os
from PySide import QtGui, QtCore
import sharppy.sharptab as tab
import sharppy.databases.inset_data as inset_data
from sharppy.sharptab.constants import *
## routine written by Kelton Halbert and Greg Blumberg
## keltonhalbert@ou.edu and wblumberg@ou.edu
__all__ = ['backgroundVROT', 'plot... | |
#!/usr/bin/python
# Copyright (c) 2011 Netcetera.
#
# 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, merg... | |
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | |
import os
import re
import shutil
import subprocess
import projectconfig
class Project:
def __init__(self, project_dir, config = None):
self.project_dir = project_dir
self.config = config or projectconfig
def process(self, command):
err = subprocess.Popen(command).wait()
retu... | |
# -*- coding: utf-8 -*-
import json
from .. import base
from girder.api.v1 import resource
from girder.constants import AccessType
from girder.models.model_base import AccessControlledModel
from girder.models.assetstore import Assetstore
from girder.models.collection import Collection
from girder.models.item import I... | |
#!/usr/bin/python
# 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... | |
"""Tests for deCONZ config flow."""
import asyncio
import pydeconz
from homeassistant import data_entry_flow
from homeassistant.components import ssdp
from homeassistant.components.deconz import config_flow
from homeassistant.components.deconz.config_flow import (
CONF_MANUAL_INPUT,
CONF_SERIAL,
DECONZ_MA... | |
#!/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");... | |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import collections
from matplotlib.patches import Circle
import networkx as nx
from skimage import img_as_float, morphology
from skimage.color import gray2rgb
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if imag... | |
"""The lookin integration climate platform."""
from __future__ import annotations
from collections.abc import Coroutine
from datetime import timedelta
import logging
from typing import Any, Callable, Final, cast
from aiolookin import Climate, MeteoSensor, SensorID
from homeassistant.components.climate import Climate... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Created by niphlod@gmail.com
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Scheduler with redis backend
---------------------------------
"""
import os
import time
import socket
import datetime
import loggi... | |
"""
Provide user facing operators for doing the split part of the
split-apply-combine paradigm.
"""
from __future__ import annotations
from typing import Hashable
import warnings
import numpy as np
from pandas._typing import (
ArrayLike,
FrameOrSeries,
final,
)
from pandas.errors import InvalidIndexError... | |
# coding=utf-8
# Copyright (c) 2016 Janusz Skonieczny
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import logging
import os
import threading
from datetime import date, datetime, timedelta
import six
from django.conf import settings
from django.contrib import admin
from d... | |
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, thi... | |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import os, json
from frappe import _
from frappe.modules import scrub, get_module_path
from frappe.utils import flt, cint, get_html_format, cstr
from frappe.model.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2019, The OpenThread Commissioner 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 c... | |
"""Script to check the configuration file."""
from __future__ import annotations
import argparse
import asyncio
from collections import OrderedDict
from collections.abc import Mapping, Sequence
from glob import glob
import logging
import os
from typing import Any, Callable
from unittest.mock import patch
from homeass... | |
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
# Copyright 2018-present Facebook, 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 i... | |
# coding: utf-8
#
# Copyright 2017 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 direct.directnotify.DirectNotifyGlobal import *
from otp.ai.AIBaseGlobal import *
from toontown.building import DistributedBuildingAI
from toontown.building import GagshopBuildingAI
from toontown.building import HQBuildingAI
from toontown.building import KartShopBuildingAI
from toontown.building import PetshopBui... | |
# 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... | |
#
# Copyright 2014 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
from swiftype import swiftype
import os
import time
import unittest2 as unittest
from six.moves.urllib_parse import urlparse, parse_qs
import vcr
from mock import Mock
class TestClientFunctions(unittest.TestCase):
def setUp(self):
try:
api_key = os.environ['API_KEY']
except:
... | |
# Copyright [2015] Hewlett-Packard Development Company, L.P.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
import os
from ctypes import CDLL, c_char_p, c_int, c_ulonglong, POINTER, byref, create_string_buffer
lib = CDLL('%s/../lib/0/libpqcrypto.so' % os.path.dirname(os.path.abspath(__file__)))
class wrap_hash:
def __init__(self,prefix,hlen):
self.hlen = hlen
self.c_hash = getattr(lib,'pqcrypto_hash_%s_impl' % pr... | |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <michaelpeng@tencent.com>
# Date: October 20, 2011
"""
This is the target module which is the super class
of all of the scons targets.
"""
import os
import string
import configparse
import console
from blade_util import var_to_li... | |
# -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Description:
Generates a Py... | |
# 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... | |
#!/usr/bin/env python
from __future__ import absolute_import
import datetime
import json
import os
import re
import shutil
import sqlite3
import warnings
from subprocess import Popen, PIPE
from textwrap import dedent
from unittest import TestCase, main
import scraperwiki
import six
import sys
# scraperwiki.sql._St... | |
# 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... | |
"""Tests for the Hyperion integration."""
from __future__ import annotations
from datetime import timedelta
from unittest.mock import AsyncMock, Mock, call, patch
from hyperion import const
from homeassistant.components.hyperion import (
get_hyperion_device_id,
light as hyperion_light,
)
from homeassistant.c... | |
import ctypes
try:
import av
av.t = ctypes.c_int
except:
print 'using av_64'
import av_64 as av
av.t = ctypes.c_long
import numpy as np
import pygame
global g_av_is_initialised
g_av_is_initialised = False
def setVolume(md, level):
if level == 0:
alookup = None
else:
alookup = np.arange(65536,dtype=np.int16... | |
'''Tests for UITable.'''
from mysite import settings
from scisheets.core.helpers.serialize_deserialize import serialize, \
deserialize
from scisheets.core.column import Column
from scisheets.core.table import NAME_COLUMN_STR, Table
from scisheets.helpers.command_dict import CommandDict
from Tree.named_tree import... | |
"""
Utilities and plugins for running tests with nose
Django-nose database context to run tests in two phases:
- Stage 1 runs all test that don't require DB access (test that don't inherit
from TransactionTestCase)
- Stage 2 runs all DB tests (test that do inherit from TransactionTestCase)
Adapted from testrunn... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
# Copyright (c) Ralph Meijer.
# See LICENSE for details.
"""
Tests for L{wokkel.server}.
"""
from __future__ import division, absolute_import
from twisted.internet import defer
from twisted.python import failure
from twisted.test.proto_helpers import StringTransport
from twisted.trial import unittest
from twisted.wor... | |
# 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... | |
"""
Unit tests for genome_annotation
"""
import logging
from unittest import skipUnless
from . import shared
from doekbase.data_api.taxonomy.taxon.api import TaxonAPI
from doekbase.data_api.taxonomy.taxon.api import _Prototype
from doekbase.data_api.taxonomy.taxon.api import _KBaseGenomes_Genome
_log = logging.getL... | |
from collections import OrderedDict
import wx
from classes.om import ObjectManager
from classes.ui import UIManager
from classes.ui import FrameController
from classes.ui import Frame
from app import log
SLIDER_MARGIN = 5 # Default 6
class RangeSlider(wx.Slider):
def __init__(self, *args, **kwargs):
... | |
import os.path
import threading, Queue
import shutil, tempfile
import flask
import mock
from libmproxy.proxy.config import ProxyConfig
from libmproxy.proxy.server import ProxyServer
from libmproxy.proxy.primitives import TransparentProxyMode
import libpathod.test, libpathod.pathoc
from libmproxy import flow, controlle... | |
import os,sys,re,gzip,gc
import numpy as np
import scipy as sp
import scipy.io
from scipy.sparse import *
from scipy.sparse.linalg import *
import pickle
import math
def readData(param_file,AllComb):
"""
Read in tree, chromatin marks and chromosomes from the param_file.
If AllComb is true, consider all possible co... | |
"""The tests for the DirecTV Media player platform."""
from unittest.mock import call, patch
from datetime import datetime, timedelta
import requests
import pytest
from homeassistant.components.media_player.const import (
ATTR_MEDIA_CONTENT_ID,
ATTR_MEDIA_CONTENT_TYPE,
MEDIA_TYPE_TVSHOW,
ATTR_MEDIA_EN... | |
import functools
import unittest
import itertools
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def _skip_if(cond, reason):
"""Skip test if cond(self) is True"... | |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | |
#!/usr/bin/env python
"""xml2json.py Convert XML to JSON
Relies on ElementTree for the XML parsing. This is based on
pesterfish.py but uses a different XML->JSON mapping.
The XML->JSON mapping is described at
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
Rewritten to a command line utili... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | |
#!/usr/bin/python
# Crystals (working title)
#
# Copyright (c) 2010 Matt Windsor, Michael Walker and Alexander
# Preisinger.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# *Redistribution... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Sat Oct 7 01:35:22 2017
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.sta... | |
# Copyright 2022 The Magenta 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 ... | |
# Copyright 2013 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 distutils
import glob
import heapq
import logging
import os
import os.path
import shutil
import subprocess as subprocess
import sys
import tempfile
im... | |
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy
from devilry.devilry_account.exceptions import Il... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | |
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from austria.models import PollingStation, Election, Party, List, Municipality, District, RegionalElectoralDistrict, State, PollingStationResult, ListResult
import json
import xml.etree.ElementTree as ET
import pprint
im... | |
#!/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");... | |
""" Tests from Michael Wester's 1999 paper "Review of CAS mathematical
capabilities".
http://www.math.unm.edu/~wester/cas/book/Wester.pdf
See also http://math.unm.edu/~wester/cas_review.html for detailed output of each
tested system.
"""
from sympy import (Rational, symbols, factorial, sqrt, log, exp, oo, product,
... | |
"""ThreatConnect TI Adversary"""
from ..group import Group
class Adversary(Group):
"""Unique API calls for Adversary API Endpoints
Args:
tcex (TcEx): An instantiated instance of TcEx object.
name (str, kwargs): [Required for Create] The name for this Group.
owner (str, kwargs): The na... | |
# The MIT License (MIT)
#
# Copyright (c) 2015 Lee Clemens Computing Services, LLC
#
# 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 righ... | |
import unittest
from craft_ai import Client, errors as craft_err
from . import settings
from .utils import generate_entity_id
from .data import valid_data, invalid_data
NB_AGENTS_TO_CREATE = 5
class TestCreateAgentsBulkSuccess(unittest.TestCase):
"""Checks that the client succeeds when creating
an/multiple... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.